/* Generated by Cython 0.18 on Tue Jul 07 21:16:23 2015 */

#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_ScalarVariable2;
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;

/* "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
};


/* "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;
  struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *__pyx_vtab;
  struct jm_callbacks callbacks;
  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 *_log;
  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_log_name;
  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 *_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":193
 *     cdef _add_scalar_variable(self, FMIL.fmi2_import_variable_t* variable)
 * 
 * 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":73
 * 
 * 
 * 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;
  struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *__pyx_vtab;
  fmi1_callback_functions_t callBackFunctions;
  struct jm_callbacks callbacks;
  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;
  PyObject *_log;
  int _version;
  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_log_name;
  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":65
 *     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":198
 *     cpdef _set_time(self, FMIL.fmi2_real_t t)
 * 
 * cdef class FMUModelME2(FMUModelBase2):             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_time(self)
 */
struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 __pyx_base;
};


/* "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.pxd":52
 *     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":6557
 * 
 * #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":40
 *     pass
 * 
 * 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":575
 * 
 * 
 * cdef class FMUModelBase(ModelBase):             # <<<<<<<<<<<<<<
 *     """
 *     An FMI Model loaded from a DLL.
 */

struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase {
  PyObject *(*_logger)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, jm_string, int, jm_string);
  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":2517
 *         return capabilities
 * 
 * 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":6557
 * 
 * #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":3081
 * 
 * 
 * cdef class FMUModelBase2(ModelBase):             # <<<<<<<<<<<<<<
 *     """
 *     FMI Model loaded from a dll.
 */

struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 {
  PyObject *(*_logger)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, jm_string, int, jm_string);
  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 *);
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2;


/* "pyfmi\fmi.pyx":6029
 * 
 * 
 * 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":2073
 * 
 * 
 * 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":5460
 * 
 * 
 * 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);
};
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 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 int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);

static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);

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 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 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_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 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_2append_log_message(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_log_level, PyObject *__pyx_v_message); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_4get_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_6_internal_set_fmu_null(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8print_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_convert_filter(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_expression); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_get_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_14get_ode_sizes(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_16get_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_18set_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_20get_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_22set_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_24get_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_26set_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_28get_string(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_30set_string(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref, CYTHON_UNUSED PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_32set_debug_logging(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_34set_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_36set_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_38_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_40_get(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_42get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_44get_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_46get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_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_50get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_56get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_58get_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_60get_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_62get_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_64get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_66get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_68get_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_70get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_72get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_74get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_76get_author(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_78get_default_experiment_start_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_80get_default_experiment_stop_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_82get_default_experiment_tolerance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_84get_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_86get_generation_tool(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_88get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_90estimate(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__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_12FMUModelBase_92estimate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_algorithm); /* 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 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 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(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_16set_string(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref, CYTHON_UNUSED 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_22get_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24print_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_26instantiate(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_28setup_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_30reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_32terminate(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_34exit_initialization_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_36enter_initialization_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_38initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_40set_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_42get_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_44set_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_46get_categories(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_48get_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_50get_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_52get_variable_alias_base(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_54get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_56get_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_58get_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_60get_variable_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_62get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_64get_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_66get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_68get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_70get_variable_initial(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_72get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_74get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_76get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_78get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_80get_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_82set_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_84free_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_86serialize_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_88deserialize_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_serialized_fmu); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_90serialized_fmu_state_size(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_92get_ode_sizes(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_94get_default_experiment_start_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_96get_default_experiment_stop_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_98get_default_experiment_tolerance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_100get_default_experiment_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_102_convert_filter(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_expression); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_104get_derivatives_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_106get_output_dependencies(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_108get_derivatives_dependencies(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_110_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_112_get_A(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_114_get_B(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_116_get_C(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_118_get_D(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_120get_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_122get_states_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_124get_input_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_126get_output_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_128get_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_130get_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_132get_model_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_134get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_136get_author(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_138get_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_140get_copyright(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_142get_license(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_144get_generation_tool(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_146get_generation_date_and_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_148get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_150get_variable_naming_convention(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_152get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_154get_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 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_7[] = "";
static char __pyx_k_15[] = ".";
static char __pyx_k_17[] = "The log level must be between %d and %d";
static char __pyx_k_18[] = "The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...";
static char __pyx_k_20[] = ".fmu";
static char __pyx_k_22[] = "FMUModel must be instantiated with an FMU (.fmu) file.";
static char __pyx_k_24[] = "The FMU version could not be determined. ";
static char __pyx_k_25[] = "The FMU version could not be determined. Enable logging for possibly more information.";
static char __pyx_k_27[] = "This class only supports FMI 1.0 (Model Exchange and Co-Simulation).";
static char __pyx_k_29[] = "The XML file could not be parsed. ";
static char __pyx_k_30[] = "The XML file could not be parsed. Enable logging for possibly more information.";
static char __pyx_k_33[] = "FMI_REGISTER_GLOBALLY";
static char __pyx_k_34[] = "Error loading the binary. Enable logging for possibly more information.";
static char __pyx_k_36[] = "_log.txt";
static char __pyx_k_40[] = "\n";
static char __pyx_k_43[] = "_internal_set_fmu_null";
static char __pyx_k_44[] = "Unknown input.";
static char __pyx_k_46[] = "Failed to get the Real values.";
static char __pyx_k_48[] = "The length of valueref and values are inconsistent.";
static char __pyx_k_50[] = "Failed to set the Real values.";
static char __pyx_k_52[] = "Failed to get the Integer values.";
static char __pyx_k_55[] = "Failed to set the Integer values.";
static char __pyx_k_57[] = "Failed to get the Boolean values.";
static char __pyx_k_60[] = "Failed to set the Boolean values.";
static char __pyx_k_62[] = "Failed to set the debugging option.";
static char __pyx_k_64[] = "Invalid log level for FMI Library (0-7).";
static char __pyx_k_66[] = "The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.";
static char __pyx_k_68[] = "The variable %s could not be found.";
static char __pyx_k_69[] = "Type not supported.";
static char __pyx_k_72[] = "get_variable_description";
static char __pyx_k_73[] = "get_variable_data_type";
static char __pyx_k_74[] = "get_variable_valueref";
static char __pyx_k_75[] = "The variable with value reference: %s, could not be found.";
static char __pyx_k_76[] = "Either provide value reference or variable name.";
static char __pyx_k_78[] = "The variable is not a real variable.";
static char __pyx_k_80[] = "The variable %s does not have a start value.";
static char __pyx_k_81[] = "Unknown variable type.";
static char __pyx_k_83[] = "The variable type does not have a maximum value.";
static char __pyx_k_85[] = "The variable type does not have a minimum value.";
static char __pyx_k_90[] = "get_variable_variability";
static char __pyx_k_91[] = "The variable with the valuref %i could not be found.";
static char __pyx_k_92[] = "get_variable_causality";
static char __pyx_k_94[] = "_exec_estimate_algorithm";
static char __pyx_k_95[] = "pyfmi.fmi_algorithm_drivers";
static char __pyx_k_97[] = "This class only supports FMI 1.0 for Co-simulation.";
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_100[] = "The order must be greater than zero and below the maximum output derivative support of the FMU (%d).";
static char __pyx_k_101[] = "The variables must either be a string or a list of strings";
static char __pyx_k_103[] = "Failed to get the Real output derivatives.";
static char __pyx_k_105[] = "Failed to retrieve the last successful time. See the log for possibly more information.";
static char __pyx_k_107[] = "Not supported status kind.";
static char __pyx_k_109[] = "The number of variables must be the same as the number of orders.";
static char __pyx_k_111[] = "The order must be greater than zero.";
static char __pyx_k_113[] = "The FMU does not support input derivatives.";
static char __pyx_k_116[] = "Failed to set the Real input derivatives.";
static char __pyx_k_119[] = "get_default_experiment_start_time";
static char __pyx_k_120[] = "get_default_experiment_stop_time";
static char __pyx_k_121[] = "_exec_simulate_algorithm";
static char __pyx_k_125[] = "The slave failed to initialize. See the log for possibly more information.";
static char __pyx_k_127[] = "Failed to reset the FMU.";
static char __pyx_k_130[] = "FMI_MIME_CS_STANDALONE";
static char __pyx_k_131[] = "Failed to instantiate the slave. See the log for possibly more information.";
static char __pyx_k_133[] = "Failed to set the debugging option. See the log for possibly more information.";
static char __pyx_k_135[] = "canHandleVariableCommunicationStepSize";
static char __pyx_k_136[] = "canInterpolateInputs";
static char __pyx_k_137[] = "maxOutputDerivativeOrder";
static char __pyx_k_138[] = "canRunAsynchronuously";
static char __pyx_k_139[] = "canBeInstantiatedOnlyOncePerProcess";
static char __pyx_k_140[] = "canNotUseMemoryManagementFunctions";
static char __pyx_k_142[] = "This class only supports FMI 1.0 for Model Exchange.";
static char __pyx_k_144[] = "The DLL could not be reloaded, check the log for more information.";
static char __pyx_k_146[] = "Failed to set the time.";
static char __pyx_k_148[] = "Failed to retrieve the continuous states.";
static char __pyx_k_150[] = "Failed to set the new continuous states. The number of values are not consistent with the number of continuous states.";
static char __pyx_k_152[] = "Failed to set the new continuous states.";
static char __pyx_k_154[] = "Failed to get the nominal values.";
static char __pyx_k_156[] = "Failed to get the derivative values at time: %E.";
static char __pyx_k_157[] = "Failed to get the event indicators.";
static char __pyx_k_159[] = "get_default_experiment_tolerance";
static char __pyx_k_160[] = "nominal_continuous_states";
static char __pyx_k_162[] = "Failed to update the events at time: %E.";
static char __pyx_k_163[] = "stateValueReferencesChanged";
static char __pyx_k_164[] = "Failed to get the continuous state reference values.";
static char __pyx_k_166[] = "Failed to call FMI Completed Step.";
static char __pyx_k_169[] = "Initialize returned with a warning. Check the log for information (FMUModel.get_log).";
static char __pyx_k_171[] = "Initialize returned with a warning. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_173[] = "Initialize returned with an error. Check the log for information (FMUModel.get_log).";
static char __pyx_k_175[] = "Initialize returned with an error. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_178[] = "Failed to instantiate the model. See the log for possibly more information.";
static char __pyx_k_186[] = "Could not locate the FMU in the specified directory.";
static char __pyx_k_189[] = "The FMU version is not supported by this class. ";
static char __pyx_k_190[] = "The FMU version is not supported by this class. Enable logging for possibly more information.";
static char __pyx_k_192[] = "The XML-could not be read. ";
static char __pyx_k_193[] = "The XML-could not be read. Enable logging for possible nore information.";
static char __pyx_k_195[] = "The FMU kind could not be determined. ";
static char __pyx_k_196[] = "The FMU kind could not be determined. Enable logging for possibly more information.";
static char __pyx_k_198[] = "FMUModelBase2 cannot be used directly, use FMUModelME2 or FMUModelCS2.";
static char __pyx_k_200[] = "Error loading the binary. ";
static char __pyx_k_218[] = "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_223[] = "Failed to setup the experiment.";
static char __pyx_k_225[] = "An error occured when reseting the model, see the log for possible more information";
static char __pyx_k_227[] = "Exit Initialize returned with a warning. Check the log for information (FMUModel.get_log).";
static char __pyx_k_229[] = "Exit Initialize returned with a warning. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_231[] = "Exit Initialize returned with an error. Check the log for information (FMUModel.get_log).";
static char __pyx_k_233[] = "Exit Initialize returned with an error. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_235[] = "Setup Experiment has to be called prior to the initialization method.";
static char __pyx_k_237[] = "Enter Initialize returned with a warning. Check the log for information (FMUModel.get_log).";
static char __pyx_k_239[] = "Enter Initialize returned with a warning. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_241[] = "Enter Initialize returned with an error. Check the log for information (FMUModel.get_log).";
static char __pyx_k_243[] = "Enter Initialize returned with an error. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_245[] = "enter_initialization_mode";
static char __pyx_k_246[] = "exit_initialization_mode";
static char __pyx_k_248[] = "Logging is not enabled";
static char __pyx_k_251[] = "Currently the logging of categories is not availible. See the docstring for more information";
static char __pyx_k_259[] = "get_variable_initial";
static char __pyx_k_263[] = "_supports_get_set_FMU_state";
static char __pyx_k_264[] = "This FMU does not support get and set FMU-state";
static char __pyx_k_266[] = "An error occured while trying to get the FMU-state, see the log for possible more information";
static char __pyx_k_268[] = "This FMU dos not support get and set FMU-state";
static char __pyx_k_270[] = "An error occured while trying to set the FMU-state, see the log for possible more information";
static char __pyx_k_273[] = "FMU-state does not seem to be allocated.";
static char __pyx_k_274[] = "An error occured while trying to free the FMU-state, see the log for possible more information";
static char __pyx_k_276[] = "deserialize_fmu_state";
static char __pyx_k_277[] = "serialized_fmu_state_size";
static char __pyx_k_279[] = "The returned states list is NULL.";
static char __pyx_k_281[] = "get_output_dependencies";
static char __pyx_k_282[] = "No dependency information for the outputs was found in the model description.";
static char __pyx_k_284[] = "get_derivatives_dependencies";
static char __pyx_k_285[] = "No dependency information for the derivatives was found in the model description.";
static char __pyx_k_287[] = "get_derivatives_list";
static char __pyx_k_289[] = "get_directional_derivative";
static char __pyx_k_290[] = "_get_directional_proxy";
static char __pyx_k_295[] = "The returned derivatives states list is NULL.";
static char __pyx_k_297[] = "The returned outputs list is NULL.";
static char __pyx_k_299[] = "_provides_directional_derivatives";
static char __pyx_k_300[] = "This FMU does not provide directional derivatives";
static char __pyx_k_302[] = "The length of the list with variables (var_ref) and the seed vector (V) are not equal";
static char __pyx_k_304[] = "An error occured while getting the directional derivative, see the log for possible more information";
static char __pyx_k_308[] = "This class only supports FMI 2.0 for Co-simulation.";
static char __pyx_k_310[] = "get_capability_flags";
static char __pyx_k_311[] = "Models that need an execution tool are not supported";
static char __pyx_k_314[] = "An error occured while canceling the step";
static char __pyx_k_322[] = "Status kind has to be between 0 and 3";
static char __pyx_k_324[] = "An error occured while retriving the status";
static char __pyx_k_335[] = "canGetAndSetFMUstate";
static char __pyx_k_336[] = "canSerializeFMUstate";
static char __pyx_k_337[] = "providesDirectionalDerivatives";
static char __pyx_k_340[] = "This class only supports FMI 2.0 for Model Exchange.";
static char __pyx_k_344[] = "newDiscreteStatesNeeded";
static char __pyx_k_345[] = "nominalsOfContinuousStatesChanged";
static char __pyx_k_346[] = "valuesOfContinuousStatesChanged";
static char __pyx_k_347[] = "nextEventTimeDefined";
static char __pyx_k_348[] = "Failed to enter event mode.";
static char __pyx_k_350[] = "Failed to enter continuous time mode.";
static char __pyx_k_354[] = "no_set_FMU_state_prior_to_current_point";
static char __pyx_k_362[] = "completedIntegratorStepNotNeeded";
static char __pyx_k_363[] = "completedEventIterationIsProvided";
static char __pyx_k_365[] = "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_370[] = "PyFMI currently only supports FMI 1.0.";
static char __pyx_k_380[] = "Input-argument \"kind\" can only be \"ME\", \"CS\" or \"auto\" (default) and not: ";
static char __pyx_k_382[] = "_handle_load_fmu_exception";
static char __pyx_k_384[] = "The FMU version is unsupported. ";
static char __pyx_k_385[] = "The FMU version is unsupported. Enable logging for possibly more information.";
static char __pyx_k_388[] = "PyFMI does not support co-simulation tool";
static char __pyx_k_390[] = "FMU is a ";
static char __pyx_k_391[] = " and not a ";
static char __pyx_k_394[] = "The FMU version is not found. ";
static char __pyx_k_395[] = "The FMU version is not found. Enable logging for possibly more information.";
static char __pyx_k_397[] = "ndarray is not C contiguous";
static char __pyx_k_399[] = "ndarray is not Fortran contiguous";
static char __pyx_k_401[] = "Non-native byte order not supported";
static char __pyx_k_403[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_404[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_407[] = "Format string allocated too short.";
static char __pyx_k_409[] = "\nModule containing the FMI interface Python wrappers.\n";
static char __pyx_k_410[] = "scipy.sparse";
static char __pyx_k_411[] = "*";
static char __pyx_k_412[] = "pyfmi.common.core";
static char __pyx_k_413[] = "pyfmi.common";
static char __pyx_k_414[] = "pyfmi.fmi_util";
static char __pyx_k_417[] = "C:\\Development\\PyFMI\\branches\\PyFMI-2.2.x\\src\\pyfmi\\fmi.pyx";
static char __pyx_k_418[] = "pyfmi.fmi";
static char __pyx_k_425[] = "\001";
static char __pyx_k_426[] = "\000";
static char __pyx_k_427[] = "FMI1_LAST_SUCCESSFUL_TIME";
static char __pyx_k_428[] = "application/x-fmu-sharedlibrary";
static char __pyx_k_430[] = "FMI_DEFAULT_LOG_LEVEL";
static char __pyx_k_431[] = "FMI2_INITIAL_CALCULATED";
static char __pyx_k_432[] = "FMI2_INITIAL_UNKNOWN";
static char __pyx_k_433[] = "\n    An FMU exception.\n    ";
static char __pyx_k_434[] = "_get_value_reference";
static char __pyx_k_435[] = "\n    Property for accessing the current time of the simulation. Calls the\n    low-level FMI function: fmiSetTime.\n    ";
static char __pyx_k_436[] = "_get_model_types_platform";
static char __pyx_k_437[] = "model_types_platform";
static char __pyx_k_438[] = "_get_continuous_states";
static char __pyx_k_439[] = "_set_continuous_states";
static char __pyx_k_440[] = "\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_441[] = "_get_nominal_continuous_states";
static char __pyx_k_442[] = "\n    Property for accessing the nominal values of the continuous states. Calls\n    the low-level FMI function: fmiGetNominalContinuousStates.\n    ";
static char __pyx_k_443[] = "\n    Property for accessing the current time of the simulation. Calls the\n    low-level FMI function: fmiSetTime\n    ";
static char __pyx_k_444[] = "\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_445[] = "\n    Property for accessing the nominal values of the continuous states. Calls\n    the low-level FMI function: fmi2GetNominalContinuousStates.\n    ";
static char __pyx_k_450[] = "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__fmu[] = "fmu";
static char __pyx_k__int[] = "int";
static char __pyx_k__log[] = "log";
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__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__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__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__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__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_kp_s_100;
static PyObject *__pyx_kp_s_101;
static PyObject *__pyx_kp_s_103;
static PyObject *__pyx_kp_s_105;
static PyObject *__pyx_kp_s_107;
static PyObject *__pyx_kp_s_109;
static PyObject *__pyx_kp_s_111;
static PyObject *__pyx_kp_s_113;
static PyObject *__pyx_kp_s_116;
static PyObject *__pyx_n_s_119;
static PyObject *__pyx_n_s_120;
static PyObject *__pyx_n_s_121;
static PyObject *__pyx_kp_s_125;
static PyObject *__pyx_kp_s_127;
static PyObject *__pyx_n_s_130;
static PyObject *__pyx_kp_s_131;
static PyObject *__pyx_kp_s_133;
static PyObject *__pyx_n_s_135;
static PyObject *__pyx_n_s_136;
static PyObject *__pyx_n_s_137;
static PyObject *__pyx_n_s_138;
static PyObject *__pyx_n_s_139;
static PyObject *__pyx_n_s_140;
static PyObject *__pyx_kp_s_142;
static PyObject *__pyx_kp_s_144;
static PyObject *__pyx_kp_s_146;
static PyObject *__pyx_kp_s_148;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_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_157;
static PyObject *__pyx_n_s_159;
static PyObject *__pyx_n_s_160;
static PyObject *__pyx_kp_s_162;
static PyObject *__pyx_n_s_163;
static PyObject *__pyx_kp_s_164;
static PyObject *__pyx_kp_s_166;
static PyObject *__pyx_kp_s_169;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_kp_s_171;
static PyObject *__pyx_kp_s_173;
static PyObject *__pyx_kp_s_175;
static PyObject *__pyx_kp_s_178;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_186;
static PyObject *__pyx_kp_s_189;
static PyObject *__pyx_kp_s_190;
static PyObject *__pyx_kp_s_192;
static PyObject *__pyx_kp_s_193;
static PyObject *__pyx_kp_s_195;
static PyObject *__pyx_kp_s_196;
static PyObject *__pyx_kp_s_198;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_200;
static PyObject *__pyx_kp_s_218;
static PyObject *__pyx_kp_s_22;
static PyObject *__pyx_kp_s_223;
static PyObject *__pyx_kp_s_225;
static PyObject *__pyx_kp_s_227;
static PyObject *__pyx_kp_s_229;
static PyObject *__pyx_kp_s_231;
static PyObject *__pyx_kp_s_233;
static PyObject *__pyx_kp_s_235;
static PyObject *__pyx_kp_s_237;
static PyObject *__pyx_kp_s_239;
static PyObject *__pyx_kp_s_24;
static PyObject *__pyx_kp_s_241;
static PyObject *__pyx_kp_s_243;
static PyObject *__pyx_n_s_245;
static PyObject *__pyx_n_s_246;
static PyObject *__pyx_kp_s_248;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_251;
static PyObject *__pyx_n_s_259;
static PyObject *__pyx_n_s_263;
static PyObject *__pyx_kp_s_264;
static PyObject *__pyx_kp_s_266;
static PyObject *__pyx_kp_s_268;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_270;
static PyObject *__pyx_kp_s_273;
static PyObject *__pyx_kp_s_274;
static PyObject *__pyx_n_s_276;
static PyObject *__pyx_n_s_277;
static PyObject *__pyx_kp_s_279;
static PyObject *__pyx_n_s_281;
static PyObject *__pyx_kp_s_282;
static PyObject *__pyx_n_s_284;
static PyObject *__pyx_kp_s_285;
static PyObject *__pyx_n_s_287;
static PyObject *__pyx_n_s_289;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_n_s_290;
static PyObject *__pyx_kp_s_295;
static PyObject *__pyx_kp_s_297;
static PyObject *__pyx_n_s_299;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_kp_s_300;
static PyObject *__pyx_kp_s_302;
static PyObject *__pyx_kp_s_304;
static PyObject *__pyx_kp_s_308;
static PyObject *__pyx_n_s_310;
static PyObject *__pyx_kp_s_311;
static PyObject *__pyx_kp_s_314;
static PyObject *__pyx_kp_s_322;
static PyObject *__pyx_kp_s_324;
static PyObject *__pyx_n_s_33;
static PyObject *__pyx_n_s_335;
static PyObject *__pyx_n_s_336;
static PyObject *__pyx_n_s_337;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_kp_s_340;
static PyObject *__pyx_n_s_344;
static PyObject *__pyx_n_s_345;
static PyObject *__pyx_n_s_346;
static PyObject *__pyx_n_s_347;
static PyObject *__pyx_kp_s_348;
static PyObject *__pyx_kp_s_350;
static PyObject *__pyx_n_s_354;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_n_s_362;
static PyObject *__pyx_n_s_363;
static PyObject *__pyx_kp_s_365;
static PyObject *__pyx_kp_s_370;
static PyObject *__pyx_kp_s_380;
static PyObject *__pyx_n_s_382;
static PyObject *__pyx_kp_s_384;
static PyObject *__pyx_kp_s_385;
static PyObject *__pyx_kp_s_388;
static PyObject *__pyx_kp_s_390;
static PyObject *__pyx_kp_s_391;
static PyObject *__pyx_kp_s_394;
static PyObject *__pyx_kp_s_395;
static PyObject *__pyx_kp_u_397;
static PyObject *__pyx_kp_u_399;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_kp_s_40;
static PyObject *__pyx_kp_u_401;
static PyObject *__pyx_kp_u_403;
static PyObject *__pyx_kp_u_404;
static PyObject *__pyx_kp_u_407;
static PyObject *__pyx_n_s_410;
static PyObject *__pyx_n_s_411;
static PyObject *__pyx_n_s_412;
static PyObject *__pyx_n_s_413;
static PyObject *__pyx_n_s_414;
static PyObject *__pyx_kp_s_417;
static PyObject *__pyx_n_s_418;
static PyObject *__pyx_kp_s_425;
static PyObject *__pyx_kp_s_426;
static PyObject *__pyx_n_s_427;
static PyObject *__pyx_kp_s_428;
static PyObject *__pyx_n_s_43;
static PyObject *__pyx_n_s_430;
static PyObject *__pyx_n_s_431;
static PyObject *__pyx_n_s_432;
static PyObject *__pyx_kp_s_433;
static PyObject *__pyx_n_s_434;
static PyObject *__pyx_kp_s_435;
static PyObject *__pyx_n_s_436;
static PyObject *__pyx_n_s_437;
static PyObject *__pyx_n_s_438;
static PyObject *__pyx_n_s_439;
static PyObject *__pyx_kp_s_44;
static PyObject *__pyx_kp_s_440;
static PyObject *__pyx_n_s_441;
static PyObject *__pyx_kp_s_442;
static PyObject *__pyx_kp_s_443;
static PyObject *__pyx_kp_s_444;
static PyObject *__pyx_kp_s_445;
static PyObject *__pyx_n_s_450;
static PyObject *__pyx_kp_s_46;
static PyObject *__pyx_kp_s_48;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_50;
static PyObject *__pyx_kp_s_52;
static PyObject *__pyx_kp_s_55;
static PyObject *__pyx_kp_s_57;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_60;
static PyObject *__pyx_kp_s_62;
static PyObject *__pyx_kp_s_64;
static PyObject *__pyx_kp_s_66;
static PyObject *__pyx_kp_s_68;
static PyObject *__pyx_kp_s_69;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_n_s_72;
static PyObject *__pyx_n_s_73;
static PyObject *__pyx_n_s_74;
static PyObject *__pyx_kp_s_75;
static PyObject *__pyx_kp_s_76;
static PyObject *__pyx_kp_s_78;
static PyObject *__pyx_kp_s_80;
static PyObject *__pyx_kp_s_81;
static PyObject *__pyx_kp_s_83;
static PyObject *__pyx_kp_s_85;
static PyObject *__pyx_n_s_90;
static PyObject *__pyx_kp_s_91;
static PyObject *__pyx_n_s_92;
static PyObject *__pyx_n_s_94;
static PyObject *__pyx_kp_s_95;
static PyObject *__pyx_kp_s_97;
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__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__endswith;
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__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__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_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__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_7;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_15;
static PyObject *__pyx_k_8;
static PyObject *__pyx_k_9;
static PyObject *__pyx_k_10;
static PyObject *__pyx_k_11;
static PyObject *__pyx_k_12;
static PyObject *__pyx_k_13;
static PyObject *__pyx_k_14;
static PyObject *__pyx_k_16;
static PyObject *__pyx_k_87;
static PyObject *__pyx_k_88;
static PyObject *__pyx_k_89;
static PyObject *__pyx_k_93;
static PyObject *__pyx_k_96;
static PyObject *__pyx_k_99;
static PyObject *__pyx_k_118;
static PyObject *__pyx_k_122;
static PyObject *__pyx_k_123;
static PyObject *__pyx_k_124;
static PyObject *__pyx_k_129;
static PyObject *__pyx_k_141;
static PyObject *__pyx_k_161;
static PyObject *__pyx_k_168;
static PyObject *__pyx_k_177;
static PyObject *__pyx_k_181;
static PyObject *__pyx_k_182;
static PyObject *__pyx_k_217;
static PyObject *__pyx_k_221;
static PyObject *__pyx_k_222;
static PyObject *__pyx_k_250;
static PyObject *__pyx_k_256;
static PyObject *__pyx_k_257;
static PyObject *__pyx_k_258;
static PyObject *__pyx_k_288;
static PyObject *__pyx_k_291;
static PyObject *__pyx_k_292;
static PyObject *__pyx_k_293;
static PyObject *__pyx_k_294;
static PyObject *__pyx_k_306;
static PyObject *__pyx_k_307;
static PyObject *__pyx_k_313;
static PyObject *__pyx_k_334;
static PyObject *__pyx_k_338;
static PyObject *__pyx_k_339;
static PyObject *__pyx_k_353;
static PyObject *__pyx_k_355;
static PyObject *__pyx_k_361;
static PyObject *__pyx_k_364;
static PyObject *__pyx_k_366;
static PyObject *__pyx_k_376;
static PyObject *__pyx_k_tuple_3;
static PyObject *__pyx_k_tuple_19;
static PyObject *__pyx_k_tuple_21;
static PyObject *__pyx_k_tuple_23;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_28;
static PyObject *__pyx_k_tuple_31;
static PyObject *__pyx_k_tuple_32;
static PyObject *__pyx_k_tuple_35;
static PyObject *__pyx_k_tuple_37;
static PyObject *__pyx_k_tuple_38;
static PyObject *__pyx_k_tuple_39;
static PyObject *__pyx_k_tuple_41;
static PyObject *__pyx_k_tuple_42;
static PyObject *__pyx_k_tuple_45;
static PyObject *__pyx_k_tuple_47;
static PyObject *__pyx_k_tuple_49;
static PyObject *__pyx_k_tuple_51;
static PyObject *__pyx_k_tuple_53;
static PyObject *__pyx_k_tuple_54;
static PyObject *__pyx_k_tuple_56;
static PyObject *__pyx_k_tuple_58;
static PyObject *__pyx_k_tuple_59;
static PyObject *__pyx_k_tuple_61;
static PyObject *__pyx_k_tuple_63;
static PyObject *__pyx_k_tuple_65;
static PyObject *__pyx_k_tuple_67;
static PyObject *__pyx_k_tuple_70;
static PyObject *__pyx_k_tuple_71;
static PyObject *__pyx_k_tuple_77;
static PyObject *__pyx_k_tuple_79;
static PyObject *__pyx_k_tuple_82;
static PyObject *__pyx_k_tuple_84;
static PyObject *__pyx_k_tuple_86;
static PyObject *__pyx_k_tuple_98;
static PyObject *__pyx_k_tuple_102;
static PyObject *__pyx_k_tuple_104;
static PyObject *__pyx_k_tuple_106;
static PyObject *__pyx_k_tuple_108;
static PyObject *__pyx_k_tuple_110;
static PyObject *__pyx_k_tuple_112;
static PyObject *__pyx_k_tuple_114;
static PyObject *__pyx_k_tuple_115;
static PyObject *__pyx_k_tuple_117;
static PyObject *__pyx_k_tuple_126;
static PyObject *__pyx_k_tuple_128;
static PyObject *__pyx_k_tuple_132;
static PyObject *__pyx_k_tuple_134;
static PyObject *__pyx_k_tuple_143;
static PyObject *__pyx_k_tuple_145;
static PyObject *__pyx_k_tuple_147;
static PyObject *__pyx_k_tuple_149;
static PyObject *__pyx_k_tuple_151;
static PyObject *__pyx_k_tuple_153;
static PyObject *__pyx_k_tuple_155;
static PyObject *__pyx_k_tuple_158;
static PyObject *__pyx_k_tuple_165;
static PyObject *__pyx_k_tuple_167;
static PyObject *__pyx_k_tuple_170;
static PyObject *__pyx_k_tuple_172;
static PyObject *__pyx_k_tuple_174;
static PyObject *__pyx_k_tuple_176;
static PyObject *__pyx_k_tuple_179;
static PyObject *__pyx_k_tuple_180;
static PyObject *__pyx_k_tuple_183;
static PyObject *__pyx_k_tuple_184;
static PyObject *__pyx_k_tuple_185;
static PyObject *__pyx_k_tuple_187;
static PyObject *__pyx_k_tuple_188;
static PyObject *__pyx_k_tuple_191;
static PyObject *__pyx_k_tuple_194;
static PyObject *__pyx_k_tuple_197;
static PyObject *__pyx_k_tuple_199;
static PyObject *__pyx_k_tuple_201;
static PyObject *__pyx_k_tuple_202;
static PyObject *__pyx_k_tuple_203;
static PyObject *__pyx_k_tuple_204;
static PyObject *__pyx_k_tuple_205;
static PyObject *__pyx_k_tuple_206;
static PyObject *__pyx_k_tuple_207;
static PyObject *__pyx_k_tuple_208;
static PyObject *__pyx_k_tuple_209;
static PyObject *__pyx_k_tuple_210;
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_219;
static PyObject *__pyx_k_tuple_220;
static PyObject *__pyx_k_tuple_224;
static PyObject *__pyx_k_tuple_226;
static PyObject *__pyx_k_tuple_228;
static PyObject *__pyx_k_tuple_230;
static PyObject *__pyx_k_tuple_232;
static PyObject *__pyx_k_tuple_234;
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_247;
static PyObject *__pyx_k_tuple_249;
static PyObject *__pyx_k_tuple_252;
static PyObject *__pyx_k_tuple_253;
static PyObject *__pyx_k_tuple_254;
static PyObject *__pyx_k_tuple_255;
static PyObject *__pyx_k_tuple_260;
static PyObject *__pyx_k_tuple_261;
static PyObject *__pyx_k_tuple_262;
static PyObject *__pyx_k_tuple_265;
static PyObject *__pyx_k_tuple_267;
static PyObject *__pyx_k_tuple_269;
static PyObject *__pyx_k_tuple_271;
static PyObject *__pyx_k_tuple_272;
static PyObject *__pyx_k_tuple_275;
static PyObject *__pyx_k_tuple_278;
static PyObject *__pyx_k_tuple_280;
static PyObject *__pyx_k_tuple_283;
static PyObject *__pyx_k_tuple_286;
static PyObject *__pyx_k_tuple_296;
static PyObject *__pyx_k_tuple_298;
static PyObject *__pyx_k_tuple_301;
static PyObject *__pyx_k_tuple_303;
static PyObject *__pyx_k_tuple_305;
static PyObject *__pyx_k_tuple_309;
static PyObject *__pyx_k_tuple_312;
static PyObject *__pyx_k_tuple_315;
static PyObject *__pyx_k_tuple_316;
static PyObject *__pyx_k_tuple_317;
static PyObject *__pyx_k_tuple_318;
static PyObject *__pyx_k_tuple_319;
static PyObject *__pyx_k_tuple_320;
static PyObject *__pyx_k_tuple_321;
static PyObject *__pyx_k_tuple_323;
static PyObject *__pyx_k_tuple_325;
static PyObject *__pyx_k_tuple_326;
static PyObject *__pyx_k_tuple_327;
static PyObject *__pyx_k_tuple_328;
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_341;
static PyObject *__pyx_k_tuple_342;
static PyObject *__pyx_k_tuple_343;
static PyObject *__pyx_k_tuple_349;
static PyObject *__pyx_k_tuple_351;
static PyObject *__pyx_k_tuple_352;
static PyObject *__pyx_k_tuple_356;
static PyObject *__pyx_k_tuple_357;
static PyObject *__pyx_k_tuple_358;
static PyObject *__pyx_k_tuple_359;
static PyObject *__pyx_k_tuple_360;
static PyObject *__pyx_k_tuple_367;
static PyObject *__pyx_k_tuple_368;
static PyObject *__pyx_k_tuple_369;
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_375;
static PyObject *__pyx_k_tuple_377;
static PyObject *__pyx_k_tuple_378;
static PyObject *__pyx_k_tuple_379;
static PyObject *__pyx_k_tuple_381;
static PyObject *__pyx_k_tuple_383;
static PyObject *__pyx_k_tuple_386;
static PyObject *__pyx_k_tuple_387;
static PyObject *__pyx_k_tuple_389;
static PyObject *__pyx_k_tuple_392;
static PyObject *__pyx_k_tuple_393;
static PyObject *__pyx_k_tuple_396;
static PyObject *__pyx_k_tuple_398;
static PyObject *__pyx_k_tuple_400;
static PyObject *__pyx_k_tuple_402;
static PyObject *__pyx_k_tuple_405;
static PyObject *__pyx_k_tuple_406;
static PyObject *__pyx_k_tuple_408;
static PyObject *__pyx_k_tuple_415;
static PyObject *__pyx_k_tuple_419;
static PyObject *__pyx_k_tuple_421;
static PyObject *__pyx_k_tuple_423;
static PyObject *__pyx_k_tuple_429;
static PyObject *__pyx_k_tuple_446;
static PyObject *__pyx_k_tuple_448;
static PyObject *__pyx_k_tuple_451;
static PyObject *__pyx_k_codeobj_416;
static PyObject *__pyx_k_codeobj_420;
static PyObject *__pyx_k_codeobj_422;
static PyObject *__pyx_k_codeobj_424;
static PyObject *__pyx_k_codeobj_447;
static PyObject *__pyx_k_codeobj_449;
static PyObject *__pyx_k_codeobj_452;

/* 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_vtab)->_logger(((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_vtab)->_logger(((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()             # <<<<<<<<<<<<<<
 * 
 * class FMUException(Exception):
 */
  __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 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_7);
    values[4] = __pyx_k_8;
    values[5] = __pyx_k_9;
    values[6] = __pyx_k_10;
    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 = 357; __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 = 357; __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 = 357; __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 = 357; __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":357
 *     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":362
 *                        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":363
 * 
 *         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 = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_value_reference = __pyx_t_1;

  /* "pyfmi\fmi.pyx":364
 *         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 = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_type = __pyx_t_2;

  /* "pyfmi\fmi.pyx":365
 *         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":366
 *         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 = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_variability = __pyx_t_3;

  /* "pyfmi\fmi.pyx":367
 *         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 = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_causality = __pyx_t_4;

  /* "pyfmi\fmi.pyx":368
 *         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 = 368; __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":370
 *         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":378
 *             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":381
 *     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":389
 *             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 = 389; __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":392
 *     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":401
 *             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 = 401; __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":404
 *     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":413
 *             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":416
 *     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":425
 *             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 = 425; __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":428
 *     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":437
 *             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 = 437; __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":440
 *     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":449
 *             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 = 449; __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_7);
    values[4] = __pyx_k_11;
    values[5] = __pyx_k_12;
    values[6] = __pyx_k_13;
    values[7] = __pyx_k_14;
    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 = 456; __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 = 456; __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 = 456; __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 = 456; __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":456
 *     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":462
 *                        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":463
 * 
 *         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 = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_value_reference = __pyx_t_1;

  /* "pyfmi\fmi.pyx":464
 *         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 = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_type = __pyx_t_2;

  /* "pyfmi\fmi.pyx":465
 *         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":466
 *         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 = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_variability = __pyx_t_3;

  /* "pyfmi\fmi.pyx":467
 *         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 = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_causality = __pyx_t_4;

  /* "pyfmi\fmi.pyx":468
 *         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 = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_alias = __pyx_t_5;

  /* "pyfmi\fmi.pyx":469
 *         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 = 469; __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":471
 *         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":479
 *             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":482
 *     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":490
 *             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 = 490; __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":493
 *     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":502
 *             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 = 502; __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":505
 *     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":514
 *             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":517
 *     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":526
 *             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 = 526; __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":529
 *     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":538
 *             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 = 538; __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":541
 *     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":550
 *             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 = 550; __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":553
 *     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":563
 *                               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 = 563; __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":570
 *     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":571
 *     """
 *     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_15);

    /* "pyfmi\fmi.pyx":579
 *     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_7);
    values[4] = __pyx_k_16;
    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 = 579; __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 = 579; __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":587
 * 
 *         #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 = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->_log);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_log));
  __pyx_v_self->_log = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":591
 *         #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":592
 *         self._allocated_context = 0
 *         self._allocated_dll = 0
 *         self._allocated_xml = 0             # <<<<<<<<<<<<<<
 *         self._allocated_fmu = 0
 *         self._allocated_list = False
 */
  __pyx_v_self->_allocated_xml = 0;

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

  /* "pyfmi\fmi.pyx":594
 *         self._allocated_xml = 0
 *         self._allocated_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 = 594; __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":595
 *         self._allocated_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":596
 *         self._allocated_list = False
 *         self._fmu_temp_dir = NULL
 *         self._fmu_log_name = NULL             # <<<<<<<<<<<<<<
 * 
 *         #Specify the general callback functions
 */
  __pyx_v_self->_fmu_log_name = NULL;

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

  /* "pyfmi\fmi.pyx":600
 *         #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->callbacks.calloc = calloc;

  /* "pyfmi\fmi.pyx":601
 *         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->callbacks.realloc = realloc;

  /* "pyfmi\fmi.pyx":602
 *         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->callbacks.free = free;

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

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

  /* "pyfmi\fmi.pyx":606
 *         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 = 606; __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 = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":607
 * 
 *         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 = 607; __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 = 607; __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 = 607; __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 = 607; __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 = 607; __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 = 607; __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":608
 *         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 = 608; __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 = 608; __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 = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_5) {

        /* "pyfmi\fmi.pyx":609
 *             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 = 609; __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":611
 *                     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 = 611; __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":612
 *                 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 = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_self->callbacks.log_level = __pyx_t_6;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":614
 *                 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 = 614; __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 = 614; __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 = 614; __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 = 614; __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_17), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __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 = 614; __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 = 614; __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 = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":616
 *                 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 = 616; __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 = 616; __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_19), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __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":617
 *         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 = 617; __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->callbacks.log_level = __pyx_t_6;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":619
 *             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 = 619; __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 = 619; __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 = 619; __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 = 619; __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 = 619; __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 = 619; __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 = 619; __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 = 619; __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 = 619; __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 = 619; __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":620
 * 
 *         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 = 620; __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 = 620; __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 = 620; __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 = 620; __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 = 620; __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":621
 *         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 = 621; __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":622
 *         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 = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_self->_fmu_temp_dir, __pyx_t_9);

  /* "pyfmi\fmi.pyx":625
 * 
 *         # 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 = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __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 = 625; __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":626
 *         # 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 = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __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 = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":629
 * 
 *         #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":630
 *         #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":631
 *         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":632
 *         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":634
 *         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->callbacks));

  /* "pyfmi\fmi.pyx":635
 * 
 *         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":638
 * 
 *         #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 = 638; __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 = 638; __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 = 638; __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":639
 *         #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 = 639; __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 = 639; __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":640
 *         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":642
 *         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":643
 * 
 *         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 = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyBytes_FromString(jm_get_last_error((&__pyx_v_self->callbacks))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __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 = 643; __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 = 643; __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":644
 *         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->callbacks.log_level >= jm_log_level_error);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":645
 *             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 = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_24), __pyx_v_last_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __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 = 645; __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 = 645; __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 = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":647
 *                 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 = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __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 = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L8:;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":648
 *             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":649
 *                 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 = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_28), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __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 = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":652
 * 
 *         #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 = 652; __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":653
 *         #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":654
 *         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 = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyBytes_FromString(jm_get_last_error((&__pyx_v_self->callbacks))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __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 = 654; __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 = 654; __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":655
 *         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->callbacks.log_level >= jm_log_level_error);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":656
 *             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 = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_29), __pyx_v_last_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __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 = 656; __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 = 656; __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 = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":658
 *                 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 = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __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 = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L11:;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "pyfmi\fmi.pyx":659
 *             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":662
 * 
 *         #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 = 662; __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":663
 *         #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 = 663; __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 = 663; __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 = 663; __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 = 663; __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 = 663; __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 = 663; __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":664
 *         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 = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_32), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __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 = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pyfmi\fmi.pyx":665
 *         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 = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_fmu_kind = __pyx_t_11;

  /* "pyfmi\fmi.pyx":669
 *         #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_33); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __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 = 669; __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":670
 *         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":671
 *         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 = 671; __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 = 671; __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 = 671; __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 = 671; __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":672
 *         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->callbacks.log_level >= jm_log_level_error);
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":673
 *             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 = 673; __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 = 673; __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 = 673; __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 = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":675
 *                 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 = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_35), NULL); 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_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 = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L14:;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pyfmi\fmi.pyx":676
 *             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":677
 *                 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_33); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __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 = 677; __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_33, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":680
 * 
 *         #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":683
 * 
 *         #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 = 683; __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":684
 *         #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":685
 *         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":686
 *         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 = 686; __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 = 686; __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":689
 * 
 *         #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 = 689; __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 = 689; __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 = 689; __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 = 689; __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":690
 *         #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 = 690; __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 = 690; __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 = 690; __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 = 690; __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":691
 *         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":692
 *         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":693
 *         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 = 693; __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_7), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __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 = 693; __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_36)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __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 = 693; __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 = 693; __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":694
 *         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 = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_fmu_log_name = ((char *)malloc(((strlen(__pyx_t_10) + 1) * (sizeof(char)))));

  /* "pyfmi\fmi.pyx":695
 *         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 = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_self->_fmu_log_name, __pyx_t_10);

  /* "pyfmi\fmi.pyx":698
 * 
 *         #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->_fmu_log_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __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 = 698; __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 = 698; __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 = 698; __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 = 698; __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 = 698; __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":699
 *         #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->_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 = 699; __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 = 699; __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 = 699; __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 = 699; __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 = 699; __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 = 699; __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 = 699; __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 = 699; __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 = 699; __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 = 699; __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 = 699; __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":700
 *         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 = 700; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_7);
            if (unlikely(((PyObject *)__pyx_v_self->_log) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            }
            __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self->_log), __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __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 = 700; __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->_log) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            }
            __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self->_log), __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __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 = 700; __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->_log) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            }
            __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self->_log), __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __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 = 700; __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 = 700; __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 = 700; __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 = 700; __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 = 700; __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":701
 *             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_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
          __Pyx_GOTREF(__pyx_v_self->_log);
          __Pyx_DECREF(((PyObject *)__pyx_v_self->_log));
          __pyx_v_self->_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":698
 * 
 *         #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 = 698; __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 = 698; __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 = 698; __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 = 698; __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 = 698; __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_37, NULL);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __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 = 698; __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":704
 * 
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message):             # <<<<<<<<<<<<<<
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:
 */

static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase__logger(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__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;
  __Pyx_RefNannySetupContext("_logger", 0);

  /* "pyfmi\fmi.pyx":705
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string 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":706
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string 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 = 706; __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 = 706; __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 = 706; __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 = 706; __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 = 706; __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 = 706; __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":707
 *         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 = 707; __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 = 707; __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 = 707; __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 = 707; __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 = 707; __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 = 707; __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 = 707; __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 = 707; __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":706
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string 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.FMUModelBase._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 = 706; __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 = 706; __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 = 706; __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 = 706; __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 = 706; __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_38, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __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 = 706; __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":709
 *                 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 = 709; __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 = 709; __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 = 709; __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 = 709; __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 = 709; __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 = 709; __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.FMUModelBase._logger", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3append_log_message(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3append_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 = 711; __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 = 711; __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 = 711; __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 = 711; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.append_log_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_2append_log_message(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_module, __pyx_v_log_level, __pyx_v_message);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":711
 *             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_12FMUModelBase_2append_log_message(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__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":712
 * 
 *     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":713
 *     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 = 713; __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 = 713; __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 = 713; __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 = 713; __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 = 713; __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 = 713; __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":714
 *         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 = 714; __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 = 714; __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 = 714; __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 = 714; __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 = 714; __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":713
 *     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.FMUModelBase.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 = 713; __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 = 713; __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 = 713; __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 = 713; __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 = 713; __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_39, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __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 = 713; __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":716
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 *             self._log.append([module,log_level,message])             # <<<<<<<<<<<<<<
 * 
 *     def get_log(self):
 */
    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 = 716; __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 = 716; __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 = 716; __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.FMUModelBase.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_12FMUModelBase_5get_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_4get_log[] = "\n        Returns the log information as a list. To turn on the logging use the\n        method, set_debug_logging(True) in the instantiation,\n        FMUModel(..., enable_logging=True). The log is stored as a list of lists.\n        For example log[0] are the first log message to the log and consists of,\n        in the following order, the instance name, the status, the category and\n        the message.\n\n        Returns::\n\n            log - A list of lists.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_5get_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_log (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_4get_log(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":718
 *             self._log.append([module,log_level,message])
 * 
 *     def get_log(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the log information as a list. To turn on the logging use the
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_4get_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  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;
  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;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_log", 0);

  /* "pyfmi\fmi.pyx":731
 *             log - A list of lists.
 *         """
 *         log = []             # <<<<<<<<<<<<<<
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __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":732
 *         """
 *         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":733
 *         log = []
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     line = file.readline()
 */
    /*with:*/ {
      __pyx_t_1 = PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __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 = 733; __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__r));
      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__r));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r));
      __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 = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __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 = 733; __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_1); __pyx_t_1 = 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":734
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:
 *                 while True:             # <<<<<<<<<<<<<<
 *                     line = file.readline()
 *                     if line == "":
 */
            while (1) {
              if (!1) break;

              /* "pyfmi\fmi.pyx":735
 *             with open(self._fmu_log_name,'r') as file:
 *                 while True:
 *                     line = file.readline()             # <<<<<<<<<<<<<<
 *                     if line == "":
 *                         break
 */
              __pyx_t_5 = PyObject_GetAttr(__pyx_v_file, __pyx_n_s__readline); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_v_line);
              __pyx_v_line = __pyx_t_1;
              __pyx_t_1 = 0;

              /* "pyfmi\fmi.pyx":736
 *                 while True:
 *                     line = file.readline()
 *                     if line == "":             # <<<<<<<<<<<<<<
 *                         break
 *                     log.append(line.strip("\n"))
 */
              __pyx_t_1 = PyObject_RichCompare(__pyx_v_line, ((PyObject *)__pyx_kp_s_7), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (__pyx_t_2) {

                /* "pyfmi\fmi.pyx":737
 *                     line = file.readline()
 *                     if line == "":
 *                         break             # <<<<<<<<<<<<<<
 *                     log.append(line.strip("\n"))
 *         return log
 */
                goto __pyx_L18_break;
                goto __pyx_L19;
              }
              __pyx_L19:;

              /* "pyfmi\fmi.pyx":738
 *                     if line == "":
 *                         break
 *                     log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 *         return log
 * 
 */
              __pyx_t_1 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_9 = PyList_Append(__pyx_v_log, __pyx_t_5); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            }
            __pyx_L18_break:;
          }
          __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_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "pyfmi\fmi.pyx":733
 *         log = []
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     line = file.readline()
 */
          /*except:*/ {
            __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_log", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            __pyx_t_11 = PyObject_Call(__pyx_t_4, __pyx_t_10, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __pyx_t_12 = (!__pyx_t_2);
            if (__pyx_t_12) {
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_3);
              __Pyx_ErrRestore(__pyx_t_5, __pyx_t_1, __pyx_t_3);
              __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
              goto __pyx_L22;
            }
            __pyx_L22:;
            __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_42, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __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 = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
      }
      goto __pyx_L23;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L23:;
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":739
 *                         break
 *                     log.append(line.strip("\n"))
 *         return log             # <<<<<<<<<<<<<<
 * 
 *     cpdef _internal_set_fmu_null(self):
 */
  __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_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.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":741
 *         return 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_7_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_43); 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);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_7_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 = 741; __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":746
 *         fmu state to NULL
 *         """
 *         self._fmu = NULL             # <<<<<<<<<<<<<<
 * 
 *     def print_log(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_7_internal_set_fmu_null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_6_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_7_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_6_internal_set_fmu_null(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":741
 *         return 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_6_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_vtab)->_internal_set_fmu_null(__pyx_v_self, 1); 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.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_9print_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_8print_log[] = "\n        Prints the log information to the prompt.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_9print_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_log (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8print_log(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":748
 *         self._fmu = NULL
 * 
 *     def print_log(self):             # <<<<<<<<<<<<<<
 *         """
 *         Prints the log information to the prompt.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8print_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  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;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_log", 0);

  /* "pyfmi\fmi.pyx":753
 *         """
 *         cdef int N
 *         log = self.get_log()             # <<<<<<<<<<<<<<
 *         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 = 753; __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 = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_log = __pyx_t_2;
  __pyx_t_2 = 0;

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

  /* "pyfmi\fmi.pyx":756
 *         N = len(log)
 * 
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             print log[i]
 *             #print "FMIL: module = %s, log level = %d: %s"%(log[i][0], log[i][1], log[i][2])
 */
  __pyx_t_4 = __pyx_v_N;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "pyfmi\fmi.pyx":757
 * 
 *         for i in range(N):
 *             print log[i]             # <<<<<<<<<<<<<<
 *             #print "FMIL: module = %s, log level = %d: %s"%(log[i][0], log[i][1], log[i][2])
 * 
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_log, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __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_AddTraceback("pyfmi.fmi.FMUModelBase.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_12FMUModelBase_11_convert_filter(PyObject *__pyx_v_self, PyObject *__pyx_v_expression); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_10_convert_filter[] = "\n        Convert a filter based on unix filename pattern matching to a\n        list of regular expressions.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_11_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_12FMUModelBase_10_convert_filter(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_expression));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":760
 *             #print "FMIL: module = %s, log level = %d: %s"%(log[i][0], log[i][1], log[i][2])
 * 
 *     def _convert_filter(self, expression):             # <<<<<<<<<<<<<<
 *         """
 *         Convert a filter based on unix filename pattern matching to a
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_convert_filter(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__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_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_convert_filter", 0);

  /* "pyfmi\fmi.pyx":765
 *         list of regular expressions.
 *         """
 *         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 = 765; __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":766
 *         """
 *         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":767
 *         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 = 767; __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 = 767; __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 = 767; __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 = 767; __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":768
 *         if isinstance(expression,str):
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]             # <<<<<<<<<<<<<<
 *         elif isinstance(expression,list):
 *             for i in expression:
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __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 = 768; __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 = 768; __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 = 768; __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 = 768; __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":769
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):             # <<<<<<<<<<<<<<
 *             for i in expression:
 *                 regex = fnmatch.translate(i)
 */
  __pyx_t_2 = PyList_Check(__pyx_v_expression); 
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":770
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):
 *             for i in expression:             # <<<<<<<<<<<<<<
 *                 regex = fnmatch.translate(i)
 *                 regexp.append(re.compile(regex))
 */
    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 = 770; __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 = 770; __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 = 770; __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 = 770; __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 = 770; __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 = 770; __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":771
 *         elif isinstance(expression,list):
 *             for i in expression:
 *                 regex = fnmatch.translate(i)             # <<<<<<<<<<<<<<
 *                 regexp.append(re.compile(regex))
 *         else:
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__fnmatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __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 = 771; __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 = 771; __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 = 771; __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_XDECREF(__pyx_v_regex);
      __pyx_v_regex = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "pyfmi\fmi.pyx":772
 *             for i in expression:
 *                 regex = fnmatch.translate(i)
 *                 regexp.append(re.compile(regex))             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("Unknown input.")
 */
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__compile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_regex);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_regex);
      __Pyx_GIVEREF(__pyx_v_regex);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __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_7)); __pyx_t_7 = 0;
      __pyx_t_8 = PyList_Append(__pyx_v_regexp, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __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;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":774
 *                 regexp.append(re.compile(regex))
 *         else:
 *             raise FMUException("Unknown input.")             # <<<<<<<<<<<<<<
 *         return regexp
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __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 = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":775
 *         else:
 *             raise FMUException("Unknown input.")
 *         return regexp             # <<<<<<<<<<<<<<
 * 
 *     def _get_version(self):
 */
  __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.FMUModelBase._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 PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_13_get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_12_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_13_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_12_get_version(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":777
 *         return regexp
 * 
 *     def _get_version(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the FMI version of the Model which it was generated according.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_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":790
 *             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":791
 *         """
 *         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 = 791; __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_15get_ode_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_14get_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_15get_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_14get_ode_sizes(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":795
 *     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_14get_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":812
 *             [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 = 812; __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 = 812; __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 = 812; __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_17get_real(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_16get_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_17get_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_16get_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":814
 *         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_16get_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":836
 *         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).flatten()             # <<<<<<<<<<<<<<
 *         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 = 836; __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 = 836; __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 = 836; __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 = 836; __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 = 836; __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 = 836; __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 = 836; __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 = 836; __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 = 836; __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 = 836; __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 = 836; __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 = 836; __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 = 836; __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":837
 *         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).flatten()
 *         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 = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":838
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).flatten()
 *         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 = 838; __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 = 838; __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 = 838; __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 = 838; __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 = 838; __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 = 838; __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 = 838; __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 = 838; __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 = 838; __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 = 838; __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 = 838; __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 = 838; __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 = 838; __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":841
 * 
 * 
 *         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":843
 *         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":844
 * 
 *         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 = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __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 = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":846
 *             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_19set_real(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_18set_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_19set_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 = 848; __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 = 848; __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 = 848; __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_18set_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":848
 *         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_18set_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;
  Py_ssize_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":868
 *         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).flatten()             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array(values, dtype=N.float, ndmin=1).flatten()
 *         nref = len(val_ref)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __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 = 868; __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 = 868; __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 = 868; __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 = 868; __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 = 868; __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 = 868; __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 = 868; __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 = 868; __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 = 868; __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 = 868; __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 = 868; __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 = 868; __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":869
 *         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).flatten()
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array(values, dtype=N.float, ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *         nref = len(val_ref)
 * 
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __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 = 869; __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 = 869; __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 = 869; __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 = 869; __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 = 869; __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 = 869; __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 = 869; __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 = 869; __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__flatten); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __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 = 869; __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 = 869; __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 = 869; __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":870
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).flatten()
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array(values, dtype=N.float, ndmin=1).flatten()
 *         nref = len(val_ref)             # <<<<<<<<<<<<<<
 * 
 *         if val_ref.size != val.size:
 */
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_val_ref)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":872
 *         nref = len(val_ref)
 * 
 *         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 = 872; __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 = 872; __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 = 872; __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 = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":873
 * 
 *         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 = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __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 = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":876
 *                 '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":878
 *         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":879
 * 
 *         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 = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __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 = 879; __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_21get_integer(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_20get_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_21get_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_20get_integer(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":881
 *             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_20get_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;
  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_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":903
 *         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).flatten()             # <<<<<<<<<<<<<<
 * 
 *         nref = len(valueref)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __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 = 903; __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 = 903; __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 = 903; __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 = 903; __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 = 903; __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 = 903; __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 = 903; __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 = 903; __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 = 903; __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 = 903; __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 = 903; __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 = 903; __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":905
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).flatten()
 * 
 *         nref = len(valueref)             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] val = N.array([0]*nref, dtype=int,ndmin=1)
 * 
 */
  __pyx_t_7 = PyObject_Length(__pyx_v_valueref); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":906
 * 
 *         nref = len(valueref)
 *         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 = 906; __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 = 906; __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 = 906; __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 = 906; __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 = 906; __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 = 906; __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 = 906; __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 = 906; __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 = 906; __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 = 906; __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 = 906; __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":908
 *         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":910
 *         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":911
 * 
 *         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 = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_53), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __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 = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":913
 *             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_23set_integer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_22set_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_23set_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 = 915; __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 = 915; __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 = 915; __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_22set_integer(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":915
 *         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_22set_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":935
 *         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).flatten()             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] val = N.array(values, dtype=int,ndmin=1).flatten()
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __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 = 935; __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 = 935; __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 = 935; __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 = 935; __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 = 935; __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 = 935; __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 = 935; __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 = 935; __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 = 935; __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 = 935; __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 = 935; __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 = 935; __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":936
 *         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).flatten()
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] val = N.array(values, dtype=int,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 * 
 *         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 = 936; __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 = 936; __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 = 936; __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 = 936; __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 = 936; __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 = 936; __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 = 936; __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 = 936; __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__flatten); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __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 = 936; __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 = 936; __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 = 936; __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":938
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] val = N.array(values, dtype=int,ndmin=1).flatten()
 * 
 *         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 = 938; __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 = 938; __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":940
 *         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 = 940; __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 = 940; __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 = 940; __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 = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":941
 * 
 *         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 = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_54), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __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 = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":944
 *                 '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":946
 *         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":947
 * 
 *         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 = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_56), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __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 = 947; __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_25get_boolean(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_24get_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_25get_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_24get_boolean(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24get_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":972
 *         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).flatten()             # <<<<<<<<<<<<<<
 * 
 *         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 = 972; __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 = 972; __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 = 972; __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 = 972; __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 = 972; __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 = 972; __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 = 972; __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 = 972; __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 = 972; __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 = 972; __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 = 972; __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 = 972; __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 = 972; __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":974
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).flatten()
 * 
 *         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 = 974; __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 = 974; __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":976
 *         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":980
 * 
 *         #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":982
 *         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 = 982; __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":983
 * 
 *         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":984
 *         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 = 984; __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 = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

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

  /* "pyfmi\fmi.pyx":992
 *         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":993
 * 
 *         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 = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_58), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __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 = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":995
 *             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 = 995; __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 = 995; __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 = 995; __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 = 995; __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_27set_boolean(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_26set_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_27set_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 = 998; __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 = 998; __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 = 998; __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_26set_boolean(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":998
 *         #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_26set_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":1019
 *         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).flatten()             # <<<<<<<<<<<<<<
 *         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 = 1019; __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 = 1019; __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 = 1019; __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 = 1019; __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 = 1019; __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 = 1019; __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 = 1019; __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 = 1019; __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 = 1019; __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 = 1019; __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 = 1019; __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 = 1019; __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 = 1019; __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":1020
 * 
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).flatten()
 *         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 = 1020; __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 = 1020; __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":1023
 * 
 *         #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).flatten()
 */
  __pyx_v_val = malloc(((sizeof(fmi1_boolean_t)) * __pyx_v_nref));

  /* "pyfmi\fmi.pyx":1025
 *         cdef void *val = FMIL.malloc(sizeof(FMIL.fmi1_boolean_t)*nref)
 * 
 *         values = N.array(values,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *         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 = 1025; __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 = 1025; __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 = 1025; __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 = 1025; __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 = 1025; __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 = 1025; __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__flatten); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __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 = 1025; __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":1026
 * 
 *         values = N.array(values,ndmin=1).flatten()
 *         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":1027
 *         values = N.array(values,ndmin=1).flatten()
 *         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 = 1027; __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 = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":1029
 *             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":1032
 *             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":1034
 *                 (<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 = 1034; __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 = 1034; __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 = 1034; __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 = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":1035
 * 
 *         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 = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_59), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __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 = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":1039
 * 
 *         #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":1041
 *         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":1043
 *         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":1044
 * 
 *         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 = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_61), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __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 = 1044; __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_29get_string(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_28get_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_29get_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_28get_string(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1046
 *             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_28get_string(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_string", 0);

  /* "pyfmi\fmi.pyx":1066
 *         Calls the low-level FMI function: fmiGetString
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef FMIL.size_t nref
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __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.FMUModelBase.get_string", __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_31set_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_30set_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_31set_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_valueref = 0;
  CYTHON_UNUSED 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 = 1083; __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 = 1083; __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 = 1083; __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_30set_string(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1083
 *         return N.array(temp)[:]
 * 
 *     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_30set_string(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref, CYTHON_UNUSED PyObject *__pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_string", 0);

  /* "pyfmi\fmi.pyx":1101
 *         Calls the low-level FMI function: fmiSetString
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef FMIL.size_t nref
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __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.FMUModelBase.set_string", __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_33set_debug_logging(PyObject *__pyx_v_self, PyObject *__pyx_v_flag); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_32set_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_33set_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_32set_debug_logging(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_flag));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1123
 *             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_32set_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":1143
 *         #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 = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

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

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

  /* "pyfmi\fmi.pyx":1148
 *             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":1149
 * 
 *         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 = 1149; __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 = 1149; __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 = 1149; __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":1151
 *         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":1152
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def set_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 = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_63), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __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 = 1152; __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_35set_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_34set_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_12FMUModelBase_35set_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 = 1154; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_log_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_34set_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":1154
 *             raise FMUException('Failed to set the debugging option.')
 * 
 *     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_12FMUModelBase_34set_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
  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":1173
 *                     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":1174
 *         """
 *         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 = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_65), NULL); 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_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 = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1175
 *         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 set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):
 */
  __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.FMUModelBase.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_12FMUModelBase_37set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37set_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 = 1177; __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_36set_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":1177
 *         self.callbacks.log_level = level
 * 
 *     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_36set_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":1178
 * 
 *     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 = 1178; __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 = 1178; __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_67), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __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":1179
 *     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 = 1179; __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 = 1179; __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 = 1179; __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 = 1179; __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_39_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_38_set[] = "\n        Helper method to set, see docstring on set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39_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 = 1181; __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 = 1181; __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 = 1181; __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_38_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":1181
 *         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_38_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":1190
 *         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 = 1190; __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 = 1190; __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 = 1190; __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":1191
 * 
 *         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 = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1193
 *         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":1194
 * 
 *         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":1195
 *         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 = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __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 = 1195; __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 = 1195; __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 = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1197
 *             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":1198
 * 
 *         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":1199
 *         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":1201
 *         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":1202
 * 
 *         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 = 1202; __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 = 1202; __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 = 1202; __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 = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":1203
 *         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 = 1203; __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":1204
 *             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 = 1204; __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 = 1204; __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 = 1204; __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 = 1204; __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 = 1204; __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 = 1204; __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":1205
 *                 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":1206
 *             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 = 1206; __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 = 1206; __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 = 1206; __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 = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":1207
 *         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 = 1207; __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":1208
 *             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 = 1208; __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 = 1208; __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 = 1208; __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 = 1208; __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 = 1208; __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 = 1208; __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":1209
 *                 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":1210
 *             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 = 1210; __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 = 1210; __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 = 1210; __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 = 1210; __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 = 1210; __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 = 1210; __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":1211
 *         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":1212
 *             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 = 1212; __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 = 1212; __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 = 1212; __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 = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":1213
 *         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 = 1213; __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 = 1213; __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":1214
 *             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 = 1214; __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 = 1214; __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 = 1214; __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 = 1214; __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 = 1214; __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 = 1214; __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":1216
 *             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 = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_70), NULL); 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_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 = 1216; __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_41_get(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_40_get[] = "\n        Helper method to get, see docstring on get.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41_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_40_get(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_40_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":1228
 *         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 = 1228; __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 = 1228; __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 = 1228; __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":1229
 * 
 *         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 = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1231
 *         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":1232
 * 
 *         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":1233
 *         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 = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __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 = 1233; __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 = 1233; __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 = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1235
 *             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":1236
 * 
 *         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":1237
 *         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":1239
 *         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":1240
 * 
 *         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 = 1240; __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 = 1240; __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 = 1240; __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 = 1240; __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 = 1240; __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":1241
 *         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 = 1241; __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 = 1241; __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 = 1241; __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 = 1241; __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 = 1241; __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":1242
 *             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":1243
 *             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 = 1243; __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 = 1243; __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 = 1243; __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 = 1243; __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 = 1243; __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":1244
 *         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 = 1244; __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 = 1244; __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 = 1244; __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 = 1244; __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 = 1244; __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":1245
 *             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":1246
 *             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 = 1246; __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 = 1246; __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 = 1246; __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 = 1246; __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 = 1246; __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":1247
 *         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":1248
 *             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 = 1248; __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 = 1248; __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 = 1248; __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 = 1248; __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 = 1248; __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":1249
 *         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 = 1249; __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 = 1249; __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 = 1249; __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 = 1249; __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 = 1249; __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 = 1249; __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":1251
 *             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 = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_71), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __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 = 1251; __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":1253
 *             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_43get_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_72); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __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_description)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __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 = 1253; __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":1269
 *         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 = 1269; __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 = 1269; __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 = 1269; __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":1270
 * 
 *         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 = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1272
 *         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":1273
 * 
 *         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":1274
 *         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 = 1274; __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 = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __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 = 1274; __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 = 1274; __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 = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1276
 *             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":1278
 *         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 = 1278; __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_7));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
  }
  __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_43get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_42get_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_43get_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_42get_variable_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1253
 *             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_42get_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_vtab)->get_variable_description(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __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":1280
 *         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_45get_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_73); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __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_data_type)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __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 = 1280; __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 = 1280; __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":1296
 *         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 = 1296; __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 = 1296; __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 = 1296; __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":1297
 * 
 *         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 = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":1299
 *         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":1300
 * 
 *         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":1301
 *         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 = 1301; __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 = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __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 = 1301; __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 = 1301; __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 = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1303
 *             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":1305
 *         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_45get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_44get_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_45get_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_44get_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":1280
 *         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_44get_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_vtab)->get_variable_data_type(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __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 = 1280; __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":1307
 *         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_47get_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_74); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __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_valueref)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __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 = 1307; __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 = 1307; __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":1323
 *         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 = 1323; __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 = 1323; __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 = 1323; __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":1324
 * 
 *         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 = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":1326
 *         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":1327
 * 
 *         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":1328
 *         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 = 1328; __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 = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __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 = 1328; __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 = 1328; __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 = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1329
 *         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":1331
 *         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_47get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_46get_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_47get_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_46get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1307
 *         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_46get_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_vtab)->get_variable_valueref(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __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 = 1307; __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_49get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_48get_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_49get_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":1333
 *         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 = 1333; __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 = 1333; __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_48get_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_48get_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":1353
 *         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 = 1353; __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 = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":1354
 * 
 *         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 = 1354; __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":1355
 *         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":1356
 *             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 = 1356; __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 = 1356; __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 = 1356; __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_75), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __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 = 1356; __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 = 1356; __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 = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":1357
 *             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 = 1357; __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 = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":1358
 *                 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 = 1358; __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 = 1358; __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 = 1358; __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":1359
 *         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 = 1359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_variablename = __pyx_t_6;

    /* "pyfmi\fmi.pyx":1361
 *             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":1362
 * 
 *             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":1363
 *             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 = 1363; __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 = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __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 = 1363; __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 = 1363; __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 = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1365
 *                 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 = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_77), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __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 = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1367
 *             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":1368
 * 
 *         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":1369
 *         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 = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_79), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __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 = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":1371
 *             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 = 1371; __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":1373
 *         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_51get_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 = 1373; __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_51get_variable_fixed)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_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);
      __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 = 1373; __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":1390
 *         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 = 1390; __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 = 1390; __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 = 1390; __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":1391
 * 
 *         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 = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1393
 *         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":1394
 * 
 *         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":1395
 *         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 = 1395; __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 = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __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 = 1395; __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 = 1395; __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 = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1397
 *             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":1399
 *         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":1400
 * 
 *         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 = 1400; __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 = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_80), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __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 = 1400; __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 = 1400; __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 = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1402
 *             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":1404
 *         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 = 1404; __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_51get_variable_fixed(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_50get_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_51get_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_50get_variable_fixed(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1373
 *         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_50get_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_vtab)->get_variable_fixed(__pyx_v_self, __pyx_v_variable_name, 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);
  __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":1407
 * 
 * 
 *     cpdef get_variable_start(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the start value for the variable or else raises
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_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 = 1407; __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_53get_variable_start)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __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 = 1407; __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":1429
 *         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":1431
 *         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 = 1431; __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 = 1431; __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 = 1431; __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":1432
 * 
 *         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 = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1434
 *         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":1435
 * 
 *         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":1436
 *         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 = 1436; __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 = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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 = 1436; __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 = 1436; __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 = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1438
 *             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":1440
 *         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":1441
 * 
 *         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 = 1441; __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 = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_80), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __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 = 1441; __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 = 1441; __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 = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1443
 *             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":1445
 *         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":1446
 * 
 *         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":1447
 *         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 = 1447; __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":1449
 *             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":1450
 * 
 *         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":1451
 *         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 = 1451; __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":1453
 *             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":1454
 * 
 *         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":1455
 *         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 = 1455; __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":1457
 *             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":1458
 * 
 *         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":1459
 *         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 = 1459; __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":1461
 *             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":1462
 * 
 *         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":1463
 *         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 = 1463; __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":1466
 * 
 *         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 = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_82), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __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 = 1466; __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_53get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_52get_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_53get_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_52get_variable_start(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_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_vtab)->get_variable_start(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __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":1468
 *             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_55get_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 = 1468; __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_55get_variable_max)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __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 = 1468; __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":1487
 *         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 = 1487; __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 = 1487; __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 = 1487; __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":1488
 * 
 *         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 = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1490
 *         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":1491
 * 
 *         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":1492
 *         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 = 1492; __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 = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __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 = 1492; __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 = 1492; __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 = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1494
 *             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":1496
 *         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":1497
 * 
 *         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":1498
 *         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 = 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;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1500
 *             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":1501
 * 
 *         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":1502
 *         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 = 1502; __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":1504
 *             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":1505
 * 
 *         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":1506
 *         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 = 1506; __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":1509
 * 
 *         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 = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_84), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __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 = 1509; __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_55get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_54get_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_55get_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_54get_variable_max(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1468
 *             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_54get_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_vtab)->get_variable_max(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __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":1511
 *             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_57get_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 = 1511; __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_min)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __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 = 1511; __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":1530
 *         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 = 1530; __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 = 1530; __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 = 1530; __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":1531
 * 
 *         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 = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1533
 *         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":1534
 * 
 *         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":1535
 *         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 = 1535; __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 = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __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 = 1535; __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 = 1535; __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 = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1537
 *             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":1539
 *         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":1540
 * 
 *         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":1541
 *         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 = 1541; __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":1543
 *             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":1544
 * 
 *         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":1545
 *         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 = 1545; __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":1547
 *             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":1548
 * 
 *         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":1549
 *         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 = 1549; __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":1552
 * 
 *         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 = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_86), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __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 = 1552; __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_57get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_56get_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_57get_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_56get_variable_min(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1511
 *             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_56get_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_vtab)->get_variable_min(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __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_59get_model_variables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_58get_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_59get_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":1555
 * 
 * 
 *     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_87;

    /* "pyfmi\fmi.pyx":1556
 * 
 *     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_88;
    values[5] = __pyx_k_89;

    /* "pyfmi\fmi.pyx":1558
 *                             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 = 1555; __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 = 1555; __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_58get_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":1555
 * 
 * 
 *     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_58get_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":1602
 *         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 = 1602; __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":1603
 *         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 = 1603; __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":1604
 *         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":1605
 *         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":1606
 *         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":1608
 *         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 = 1608; __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":1609
 *         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":1611
 *         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":1612
 * 
 *         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":1614
 *         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 = 1614; __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 = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1615
 * 
 *         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 = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_type = __pyx_t_4;

    /* "pyfmi\fmi.pyx":1616
 *         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":1617
 *             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 = 1617; __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 = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1618
 *             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 = 1618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_causality = __pyx_t_5;

    /* "pyfmi\fmi.pyx":1619
 *         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":1620
 *             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 = 1620; __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 = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1621
 *             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 = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_variability = __pyx_t_6;

    /* "pyfmi\fmi.pyx":1622
 *         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":1623
 *             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":1624
 *             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 = 1624; __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 = 1624; __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 = 1624; __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 = 1624; __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":1625
 *         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 = 1625; __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 = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_length_filter = __pyx_t_9;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":1627
 *             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":1629
 *         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":1631
 *             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":1632
 * 
 *             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 = 1632; __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 = 1632; __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 = 1632; __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 = 1632; __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":1633
 *             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":1634
 *             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":1635
 *             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":1636
 *             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":1637
 *             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":1638
 *             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":1641
 * 
 *             #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 = 1641; __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":1642
 *             #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":1644
 *                 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 = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":1645
 * 
 *             if only_fixed:
 *                 if has_start!=1:             # <<<<<<<<<<<<<<
 *                     continue
 *                 else:
 */
      __pyx_t_13 = (__pyx_v_has_start != 1);
      if (__pyx_t_13) {

        /* "pyfmi\fmi.pyx":1646
 *             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":1648
 *                     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":1649
 *                 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":1650
 *                     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":1652
 *                         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":1653
 * 
 *             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":1654
 *             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":1655
 *                 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":1656
 *             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":1657
 *                 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":1659
 *                 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":1660
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     if re.match(filter_list[j], name):
 *                         break
 */
      __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":1661
 *             if selected_filter:
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __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 = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        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 = 1661; __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 = 1661; __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 = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        __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 = 1661; __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_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__pyx_t_13) {

          /* "pyfmi\fmi.pyx":1662
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):
 *                         break             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
          goto __pyx_L18_break;
          goto __pyx_L19;
        }
        __pyx_L19:;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":1664
 *                         break
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if include_alias:
 */
        goto __pyx_L7_continue;
      }
      __pyx_L18_break:;
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "pyfmi\fmi.pyx":1666
 *                     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 = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":1668
 *             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_7 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      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 = 1668; __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_7));
        __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
      }

      /* "pyfmi\fmi.pyx":1669
 *                 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 = 1669; __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 = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);

      /* "pyfmi\fmi.pyx":1670
 *                                        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 = 1670; __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 = 1667; __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_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      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_7 = 0;
      __pyx_t_8 = 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 = 1667; __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":1667
 * 
 *             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 = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      goto __pyx_L20;
    }

    /* "pyfmi\fmi.pyx":1672
 *                                        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":1674
 *             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 = 1674; __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 = 1674; __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 = 1674; __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_7));
        __pyx_t_17 = ((PyObject *)__pyx_kp_s_7);
      }

      /* "pyfmi\fmi.pyx":1675
 *                 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 = 1675; __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 = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);

      /* "pyfmi\fmi.pyx":1676
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 *                                        alias_kind)             # <<<<<<<<<<<<<<
 * 
 *         #Free the variable list
 */
      __pyx_t_8 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = PyTuple_New(7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __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);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_18);
      __Pyx_GIVEREF(__pyx_t_18);
      PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_18 = 0;
      __pyx_t_19 = 0;
      __pyx_t_17 = 0;
      __pyx_t_16 = 0;
      __pyx_t_1 = 0;
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable)), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;

      /* "pyfmi\fmi.pyx":1673
 * 
 *             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_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L20;
    }
    __pyx_L20:;
    __pyx_L7_continue:;
  }

  /* "pyfmi\fmi.pyx":1679
 * 
 *         #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":1681
 *         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_61get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_60get_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_61get_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":1683
 *         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 = 1683; __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 = 1683; __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_60get_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_60get_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":1709
 *         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 = 1709; __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":1710
 *         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 = 1710; __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":1711
 *         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 = 1711; __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":1712
 *         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 = 1712; __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":1713
 *         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 = 1713; __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":1714
 *         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":1715
 *         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 = 1715; __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":1716
 *         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":1718
 *         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":1719
 * 
 *         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":1721
 *         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":1722
 * 
 *         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 = 1722; __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 = 1722; __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 = 1722; __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 = 1722; __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":1723
 *         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 = 1723; __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 = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_length_filter = __pyx_t_6;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1725
 *             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":1727
 *         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":1729
 *             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":1730
 * 
 *             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 = 1730; __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 = 1730; __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 = 1730; __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 = 1730; __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":1731
 *             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":1732
 *             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":1734
 *             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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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 = 1734; __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":1735
 * 
 *             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":1737
 *                 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 = 1737; __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 = 1737; __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 = 1737; __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 = 1737; __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 = 1737; __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 = 1737; __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 = 1737; __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 = 1737; __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":1738
 * 
 *             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":1740
 *                 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":1741
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     if re.match(filter_list[j], name):
 *                         break
 */
      __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":1742
 *             if selected_filter:
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __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 = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        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 = 1742; __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 = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __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_INCREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        __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 = 1742; __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_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_10) {

          /* "pyfmi\fmi.pyx":1743
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):
 *                         break             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
          goto __pyx_L10_break;
          goto __pyx_L11;
        }
        __pyx_L11:;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":1745
 *                         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":1747
 *                     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":1748
 *             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":1750
 *                     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":1751
 * 
 *             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":1753
 *                 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":1754
 *             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":1756
 *                 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_4 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_REAL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __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_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":1757
 * 
 *             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 = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "pyfmi\fmi.pyx":1758
 *             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 = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_INTEGER); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!__pyx_t_10) {
      __pyx_t_4 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_ENUMERATION); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __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_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __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":1759
 *                 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 = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "pyfmi\fmi.pyx":1760
 *             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 = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_BOOLEAN); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1761
 *                 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 = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L16;
    }
    __pyx_L16:;
    __pyx_L4_continue:;
  }

  /* "pyfmi\fmi.pyx":1764
 * 
 *         #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":1766
 *         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_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_3) {
    __pyx_t_5 = PyDict_Keys(__pyx_v_real_var_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __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 = 1766; __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(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 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 = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __pyx_t_5;
    __pyx_t_5 = 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 = 1766; __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 = 1766; __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 = 1766; __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 = 1766; __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 = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
    __pyx_t_5 = __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 = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __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 = 1766; __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 = 1766; __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 = 1766; __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 = 1766; __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 = 1766; __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 = 1766; __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 = 1766; __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_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_5 = 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_63get_variable_alias_base(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_62get_variable_alias_base[] = "\n        Returns the base variable for the provided variable name.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_63get_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_62get_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":1768
 *         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_62get_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":1776
 *         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 = 1776; __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 = 1776; __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 = 1776; __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":1777
 * 
 *         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 = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1779
 *         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":1780
 * 
 *         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":1781
 *         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 = 1781; __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 = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __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 = 1781; __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 = 1781; __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 = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1783
 *             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":1784
 * 
 *         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":1785
 *         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 = 1785; __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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __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 = 1785; __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 = 1785; __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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1787
 *             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 = 1787; __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 = 1787; __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 = 1787; __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 = 1787; __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":1789
 *         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_65get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_64get_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_65get_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_64get_variable_alias(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1791
 *         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_64get_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":1810
 *         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 = 1810; __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":1812
 *         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 = 1812; __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 = 1812; __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 = 1812; __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":1813
 * 
 *         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 = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1815
 *         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":1816
 * 
 *         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":1817
 *         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 = 1817; __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 = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __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 = 1817; __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 = 1817; __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 = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1819
 *             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":1821
 *         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":1824
 * 
 *         #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":1826
 *         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":1828
 *             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":1829
 * 
 *             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 = 1829; __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 = 1829; __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 = 1829; __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 = 1829; __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":1831
 *             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 = 1831; __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 = 1831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "pyfmi\fmi.pyx":1834
 * 
 *         #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":1836
 *         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":1838
 *         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_67get_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_90); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __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_67get_variable_variability)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __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 = 1838; __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 = 1838; __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":1856
 *         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 = 1856; __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 = 1856; __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 = 1856; __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":1857
 * 
 *         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 = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":1859
 *         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":1860
 * 
 *         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":1861
 *         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 = 1861; __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 = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __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 = 1861; __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 = 1861; __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 = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1862
 *         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":1864
 *         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_67get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_66get_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_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_12FMUModelBase_66get_variable_variability(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1838
 *         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_66get_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_vtab)->get_variable_variability(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __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 = 1838; __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_69get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_68get_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_69get_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 = 1866; __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 = 1866; __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 = 1866; __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_68get_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":1866
 *         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_68get_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":1882
 *         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 = 1882; __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":1883
 * 
 *         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":1884
 *         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 = 1884; __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 = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_91), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __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 = 1884; __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 = 1884; __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 = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1886
 *             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 = 1886; __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 = 1886; __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 = 1886; __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 = 1886; __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":1888
 *         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":1890
 *         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_71get_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_92); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __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_71get_variable_causality)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __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 = 1890; __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 = 1890; __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":1907
 *         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 = 1907; __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 = 1907; __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 = 1907; __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":1908
 * 
 *         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 = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":1910
 *         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":1911
 * 
 *         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":1912
 *         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 = 1912; __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 = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __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 = 1912; __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 = 1912; __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 = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1914
 *             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":1916
 *         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_71get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_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, INPUT(0), OUTPUT(1),\n            INTERNAL(2), NONE(3)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_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_12FMUModelBase_70get_variable_causality(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1890
 *         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_70get_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_vtab)->get_variable_causality(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __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 = 1890; __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_73get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_72get_name[] = "\n        Return the model name as used in the modeling environment.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_73get_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_72get_name(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1918
 *         return causality
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model name as used in the modeling environment.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_72get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_name", 0);

  /* "pyfmi\fmi.pyx":1922
 *         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_75get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_74get_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_75get_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_74get_identifier(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1924
 *         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_74get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_identifier", 0);

  /* "pyfmi\fmi.pyx":1929
 *         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_77get_author(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_76get_author[] = "\n        Return the name and organization of the model author.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_77get_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_76get_author(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1931
 *         return self._modelid
 * 
 *     def get_author(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the name and organization of the model author.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_76get_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":1936
 *         """
 *         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":1937
 *         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 = 1937; __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_7));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
  }
  __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_79get_default_experiment_start_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_78get_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_79get_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_78get_default_experiment_start_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1939
 *         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_78get_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":1944
 *         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 = 1944; __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_81get_default_experiment_stop_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_80get_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_81get_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_80get_default_experiment_stop_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1946
 *         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_80get_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":1951
 *         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 = 1951; __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_83get_default_experiment_tolerance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_82get_default_experiment_tolerance[] = "\n        Returns the default experiment tolerance as defined in the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_83get_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_82get_default_experiment_tolerance(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1953
 *         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_82get_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":1958
 *         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 = 1958; __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_85get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_84get_description[] = "\n        Return the model description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_85get_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_84get_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1960
 *         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_84get_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":1965
 *         """
 *         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":1966
 *         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 = 1966; __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_7));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
  }
  __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_87get_generation_tool(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_86get_generation_tool[] = "\n        Return the model generation tool.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_87get_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_86get_generation_tool(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1968
 *         return desc if desc != NULL else ""
 * 
 *     def get_generation_tool(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model generation tool.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_86get_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":1973
 *         """
 *         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":1974
 *         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 = 1974; __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_7));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
  }
  __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_89get_guid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_88get_guid[] = "\n        Return the model GUID.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_89get_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_88get_guid(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1976
 *         return gen if gen != NULL else ""
 * 
 *     def get_guid(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model GUID.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_88get_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":1980
 *         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 = 1980; __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 = 1980; __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 = 1980; __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 = 1980; __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":1981
 *         """
 *         guid = decode(FMIL.fmi1_import_get_GUID(self._fmu))
 *         return guid             # <<<<<<<<<<<<<<
 * 
 *     def estimate(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.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_91estimate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_90estimate[] = "\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        FMUModel.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\n                Default: None (required)\n\n            measurments --\n                The measurements data (name, data). Note that the measurements\n                needs to be distinct and equally spaced.\n                Default: None (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 AssimuloFMIAlgOptions with\n                      default values on all options except the ones\n                      listed in the dict. Empty dic""t 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_12FMUModelBase_91estimate(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":1986
 *                  parameters,
 *                  measurements,
 *                  input=(),             # <<<<<<<<<<<<<<
 *                  algorithm='SciEstAlg',
 *                  options={}):
 */
    values[2] = ((PyObject *)__pyx_empty_tuple);
    values[3] = ((PyObject *)__pyx_n_s__SciEstAlg);
    values[4] = __pyx_k_93;
    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 = 1983; __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 = 1983; __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 = 1983; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.estimate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_90estimate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__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":1983
 *         return guid
 * 
 *     def estimate(self,             # <<<<<<<<<<<<<<
 *                  parameters,
 *                  measurements,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_90estimate(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__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":2046
 *         """
 * 
 *         return self._exec_estimate_algorithm(parameters,             # <<<<<<<<<<<<<<
 *                                              measurements,
 *                                              input,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_94); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyfmi\fmi.pyx":2051
 *                                              '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 = 2046; __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_95));
  PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __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 = 2046; __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.FMUModelBase.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_12FMUModelBase_93estimate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_92estimate_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_12FMUModelBase_93estimate_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 = 2053; __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 = 2053; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.estimate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_92estimate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_algorithm);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_92estimate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__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":2070
 *             Options class for the algorithm specified with default values.
 *         """
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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 = 2070; __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 = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_95));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __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 = 2070; __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.FMUModelBase.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_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":88
 * 
 *     #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":89
 *     #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":90
 *     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":91
 *     cdef public object _file_open
 *     cdef public object _npoints
 *     cdef public object _enable_logging             # <<<<<<<<<<<<<<
 *     cdef public object _pyEventInfo
 *     cdef list _log
 */

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":92
 *     cdef public object _npoints
 *     cdef public object _enable_logging
 *     cdef public object _pyEventInfo             # <<<<<<<<<<<<<<
 *     cdef list _log
 *     cdef int _version
 */

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":101
 *     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 = 101; __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":102
 *     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 = 102; __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":103
 *     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_log_name
 */

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 = 103; __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_15);

    /* "pyfmi\fmi.pyx":2077
 *     #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_7);
    values[4] = __pyx_k_96;
    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 = 2077; __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 = 2077; __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":2079
 *     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 = 2079; __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 = 2079; __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 = 2079; __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":2081
 *         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 = 2081; __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 = 2081; __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 = 2081; __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 = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2082
 * 
 *         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 = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_98), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __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 = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2084
 *             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 = 2084; __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 = 2084; __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 = 2084; __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 = 2084; __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":2086
 *         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 = 2086; __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 = 2086; __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":2087
 * 
 *     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":2086
 *         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_vtab)->_get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2086; __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":2089
 *         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 = 2089; __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 = 2089; __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 = 2089; __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 = 2089; __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":2090
 * 
 *     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 = 2090; __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 = 2089; __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":2089
 *         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_vtab)->_set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; __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":2098
 *     """)
 * 
 *     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":2102
 *         Deallocate memory allocated
 *         """
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_terminate_slave(self._fmu)
 *             FMIL.fmi1_import_free_slave_instance(self._fmu)
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2103
 *         """
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate_slave(self._fmu)             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free_slave_instance(self._fmu)
 * 
 */
    fmi1_import_terminate_slave(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":2104
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate_slave(self._fmu)
 *             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_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2106
 *             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":2107
 * 
 *         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_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2109
 *             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":2110
 * 
 *         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_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":2112
 *             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":2113
 * 
 *         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.callbacks), __pyx_v_self->__pyx_base._fmu_temp_dir);

    /* "pyfmi\fmi.pyx":2114
 *         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":2115
 *             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":2117
 *             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":2118
 * 
 *         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":2120
 *             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._fmu_log_name != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2121
 * 
 *         if self._fmu_log_name != NULL:
 *             FMIL.free(self._fmu_log_name)             # <<<<<<<<<<<<<<
 *             self._fmu_log_name = NULL
 * 
 */
    free(__pyx_v_self->__pyx_base._fmu_log_name);

    /* "pyfmi\fmi.pyx":2122
 *         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._fmu_log_name = NULL;
    goto __pyx_L8;
  }
  __pyx_L8:;

  __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_99;
    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 = 2124; __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 = 2124; __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 = 2124; __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 = 2124; __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 = 2124; __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":2124
 *             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":2151
 *         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 = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2152
 * 
 *         if new_step:
 *             new_s = 1             # <<<<<<<<<<<<<<
 *         else:
 *             new_s = 0
 */
    __pyx_v_new_s = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2154
 *             new_s = 1
 *         else:
 *             new_s = 0             # <<<<<<<<<<<<<<
 * 
 *         self.time = current_t+step_size
 */
    __pyx_v_new_s = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2156
 *             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 = 2156; __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 = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2158
 *         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":2160
 *         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 = 2160; __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":2163
 * 
 * 
 *     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":2168
 *         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 = 2168; __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 = 2170; __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 = 2170; __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 = 2170; __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 = 2170; __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":2170
 *         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":2191
 *         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":2192
 * 
 *         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":2194
 *         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":2195
 * 
 *         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 = 2195; __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 = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_100), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2195; __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 = 2195; __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 = 2195; __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 = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2197
 *             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).flatten()
 */
  __pyx_t_3 = PyString_Check(__pyx_v_variables); 
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2198
 * 
 *         if isinstance(variables,str):
 *             nref = 1             # <<<<<<<<<<<<<<
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()
 *             orders = N.array(order, dtype=N.int32)
 */
    __pyx_v_nref = 1;

    /* "pyfmi\fmi.pyx":2199
 *         if isinstance(variables,str):
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *             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 = 2199; __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 = 2199; __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 = 2199; __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 = 2199; __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 = 2199; __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 = 2199; __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 = 2199; __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 = 2199; __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 = 2199; __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 = 2199; __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__flatten); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2199; __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 = 2199; __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 = 2199; __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 = 2199; __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":2200
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()
 *             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 = 2200; __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 = 2200; __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 = 2200; __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 = 2200; __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 = 2200; __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 = 2200; __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 = 2200; __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 = 2200; __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 = 2200; __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 = 2200; __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 = 2200; __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":2201
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()
 *             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_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 = 2201; __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 = 2201; __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":2202
 *             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).flatten()
 */
  __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 = 2202; __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":2203
 *             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).flatten()
 *             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 = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_nref = __pyx_t_17;

    /* "pyfmi\fmi.pyx":2204
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 *             nref = len(variables)
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *             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 = 2204; __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 = 2204; __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 = 2204; __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 = 2204; __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 = 2204; __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 = 2204; __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 = 2204; __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 = 2204; __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 = 2204; __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 = 2204; __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__flatten); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2204; __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 = 2204; __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 = 2204; __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 = 2204; __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":2205
 *             nref = len(variables)
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).flatten()
 *             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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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 = 2205; __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":2206
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).flatten()
 *             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":2207
 *             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 = 2207; __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_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 = 2207; __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 = 2207; __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":2208
 *             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 = 2208; __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":2210
 *                 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 = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_102), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __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 = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2212
 *             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 = 2212; __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 = 2212; __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 = 2212; __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 = 2212; __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 = 2212; __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 = 2212; __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 = 2212; __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 = 2212; __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 = 2212; __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 = 2212; __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 = 2212; __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 = 2212; __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 = 2212; __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":2214
 *         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":2216
 *         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":2217
 * 
 *         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 = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_104), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __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 = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":2219
 *             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":2221
 *         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":2235
 *             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 = 2235; __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":2239
 *     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":2242
 *         """
 *         """
 *         cdef FMIL.fmi1_real_t value = 0.0             # <<<<<<<<<<<<<<
 *         cdef int status
 * 
 */
  __pyx_v_value = 0.0;

  /* "pyfmi\fmi.pyx":2245
 *         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 = 2245; __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 = 2245; __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 = 2245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2246
 * 
 *         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":2248
 *             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":2249
 * 
 *             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 = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __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 = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "pyfmi\fmi.pyx":2251
 *                 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 = 2251; __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":2253
 *             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 = 2253; __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 = 2253; __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 = 2253; __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 = 2256; __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 = 2256; __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 = 2256; __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 = 2256; __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":2256
 * 
 * 
 *     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;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  fmi1_value_reference_t __pyx_t_16;
  long __pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  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":2274
 *         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).flatten()             # <<<<<<<<<<<<<<
 *         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).flatten()
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __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 = 2274; __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 = 2274; __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 = 2274; __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 = 2274; __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 = 2274; __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 = 2274; __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 = 2274; __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 = 2274; __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 = 2274; __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 = 2274; __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 = 2274; __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 = 2274; __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":2276
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] np_orders = N.array(orders, dtype=N.int32, ndmin=1).flatten()
 *         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).flatten()             # <<<<<<<<<<<<<<
 * 
 *         nref = len(val)
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __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 = 2276; __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 = 2276; __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 = 2276; __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 = 2276; __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 = 2276; __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 = 2276; __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 = 2276; __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 = 2276; __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__flatten); 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(__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 = 2276; __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 = 2276; __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 = 2276; __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":2278
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array(values, dtype=N.float, ndmin=1).flatten()
 * 
 *         nref = len(val)             # <<<<<<<<<<<<<<
 *         orders = N.array([0]*nref, dtype=N.int32)
 * 
 */
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_val)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":2279
 * 
 *         nref = len(val)
 *         orders = N.array([0]*nref, dtype=N.int32)             # <<<<<<<<<<<<<<
 * 
 *         if nref != len(np_orders):
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __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 = 2279; __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 = 2279; __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 = 2279; __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 = 2279; __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 = 2279; __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 = 2279; __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 = 2279; __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 = 2279; __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":2281
 *         orders = N.array([0]*nref, dtype=N.int32)
 * 
 *         if nref != len(np_orders):             # <<<<<<<<<<<<<<
 *             raise FMUException("The number of variables must be the same as the number of orders.")
 * 
 */
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_np_orders)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = (__pyx_v_nref != __pyx_t_8);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":2282
 * 
 *         if nref != len(np_orders):
 *             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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_110), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __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 = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2284
 *             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":2285
 * 
 *         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":2288
 *         #NOTE IS THIS THE HIGHEST ORDER OF INTERPOLATION OR SIMPLY IF IT CAN OR NOT?
 * 
 *         for i in range(len(np_orders)):             # <<<<<<<<<<<<<<
 *             if np_orders[i] < 1:
 *                 raise FMUException("The order must be greater than zero.")
 */
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_np_orders)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(1); 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);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); 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_10 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_10(__pyx_t_2);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __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":2289
 * 
 *         for i in range(len(np_orders)):
 *             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 = 2289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __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 = 2289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":2290
 *         for i in range(len(np_orders)):
 *             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_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_112), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2290; __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 = 2290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2291
 *             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":2292
 *                 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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); 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_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __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 = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":2294
 *             raise FMUException("The FMU does not support input derivatives.")
 * 
 *         if isinstance(variables,str):             # <<<<<<<<<<<<<<
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()
 *             value_refs[0] = self.get_variable_valueref(variables)
 */
  __pyx_t_9 = PyString_Check(__pyx_v_variables); 
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":2295
 * 
 *         if isinstance(variables,str):
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *             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 = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __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 = 2295; __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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __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 = 2295; __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 = 2295; __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 = 2295; __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 = 2295; __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 = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __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_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __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 = 2295; __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 = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
        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_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        }
      }
      __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_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":2296
 *         if isinstance(variables,str):
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()
 *             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).flatten()
 */
    __pyx_t_16 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__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 = 2296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_17 = 0;
    __pyx_t_12 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_12 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_12 = 0;
    if (unlikely(__pyx_t_12 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_12);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_16;
    goto __pyx_L8;
  }

  /* "pyfmi\fmi.pyx":2297
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()
 *             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).flatten()
 *             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 = 2297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_18 = PyString_Check(__pyx_t_3); 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_19 = __pyx_t_18;
  } else {
    __pyx_t_19 = __pyx_t_9;
  }
  if (__pyx_t_19) {

    /* "pyfmi\fmi.pyx":2298
 *             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).flatten()             # <<<<<<<<<<<<<<
 *             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 = 2298; __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 = 2298; __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 = 2298; __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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 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 = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__uint32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __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 = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __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(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__flatten); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __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 = 2298; __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 = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_12 < 0)) {
        PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__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_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_15, __pyx_t_14, __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_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":2299
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).flatten()
 *             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 = 2299; __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 = 2299; __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 = 2299; __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_8 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_10(__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 = 2299; __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":2300
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).flatten()
 *             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 = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_16 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__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 = 2300; __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_16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __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 = 2300; __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":2302
 *                 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 = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_115), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2302; __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 = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":2304
 *             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":2306
 *         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_19 = (__pyx_v_status != 0);
  if (__pyx_t_19) {

    /* "pyfmi\fmi.pyx":2307
 * 
 *         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 = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_117), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; __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 = 2307; __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":2312
 *                  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_118;
    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 = 2309; __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 = 2309; __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":2309
 *             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":2372
 *             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 = 2372; __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 = 2372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2373
 *         """
 *         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_119); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; __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 = 2373; __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":2374
 *         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 = 2374; __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 = 2374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2375
 *             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_120); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2375; __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 = 2375; __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":2377
 *             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_121); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyfmi\fmi.pyx":2382
 *                                              '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 = 2377; __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_95));
  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __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 = 2377; __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 = 2384; __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 = 2384; __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":2384
 *                                              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":2401
 *             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 = 2401; __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 = 2401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_95));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __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 = 2401; __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_122;
    values[1] = __pyx_k_123;
    values[2] = __pyx_k_124;
    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 = 2403; __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 = 2403; __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":2403
 *         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":2416
 *         """
 *         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 = 2416; __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":2418
 *         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 = 2418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":2420
 *         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 = 2420; __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 = 2420; __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":2422
 *         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":2423
 * 
 *         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 = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_126), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __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 = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2425
 *             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":2427
 *         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":2433
 *         """
 * 
 *         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":2434
 * 
 *         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":2435
 *         status = FMIL.fmi1_import_reset_slave(self._fmu)
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("Failed to reset the FMU.")             # <<<<<<<<<<<<<<
 * 
 *         #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 = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_128), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __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 = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2438
 * 
 *         #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":2441
 * 
 *         #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 = 2441; __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":2442
 *         #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":2443
 *         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 = 2443; __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.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_129;
    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 = 2446; __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 = 2446; __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":2446
 * 
 * 
 *     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":2463
 *         """
 *         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 = 2463; __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":2464
 *         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":2465
 *         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":2466
 *         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":2467
 *         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":2469
 *         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 = 2469; __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 = 2469; __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 = 2469; __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":2470
 * 
 *         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 = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":2471
 *         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_130); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2471; __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 = 2471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":2472
 *         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":2474
 *                                         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":2475
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the slave. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *         #Just to be safe, some problems with Dymola (2012) FMUs not reacting
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_132), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2475; __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 = 2475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2479
 *         #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":2481
 *         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":2482
 * 
 *         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 = 2482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_134), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2482; __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 = 2482; __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":2484
 *             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":2500
 *             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 = 2500; __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":2503
 *         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":2505
 *         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 = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_135), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2506
 * 
 *         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 = 2506; __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 = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2507
 *         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 = 2507; __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 = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2508
 *         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 = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_136), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2509
 *         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 = 2509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_137), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2510
 *         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 = 2510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_138), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2511
 *         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 = 2511; __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 = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2512
 *         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 = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_139), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2513
 *         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 = 2513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_140), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2515
 *         capabilities["canNotUseMemoryManagementFunctions"] = FMIL.fmi1_import_get_canNotUseMemoryManagementFunctions(cap)
 * 
 *         return capabilities             # <<<<<<<<<<<<<<
 * 
 * cdef class FMUModelME1(FMUModelBase):
 */
  __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 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_15);

    /* "pyfmi\fmi.pyx":2522
 *     """
 * 
 *     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_7);
    values[4] = __pyx_k_141;
    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 = 2522; __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 = 2522; __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":2524
 *     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 = 2524; __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 = 2524; __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 = 2524; __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":2526
 *         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 = 2526; __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 = 2526; __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 = 2526; __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 = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2527
 * 
 *         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 = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_143), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __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 = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2529
 *             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 = 2529; __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 = 2529; __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 = 2529; __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 = 2529; __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":2531
 *         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":2545
 *             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 = 2545; __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":2549
 *     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":2555
 *         re-instantiates using fmiInstantiateModel.
 *         """
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2556
 *         """
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 * 
 */
    fmi1_import_terminate(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":2557
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             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_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2559
 *             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":2560
 * 
 *         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_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2563
 * 
 *         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_33); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __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 = 2563; __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":2564
 *         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":2565
 *         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 = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_145), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; __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 = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":2566
 *         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_33); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __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 = 2566; __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_33, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2569
 * 
 *         #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":2572
 * 
 *         #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 = 2572; __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":2573
 *         #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":2574
 *         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 = 2574; __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._log);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base._log));
  __pyx_v_self->__pyx_base._log = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2577
 * 
 *         #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 = 2577; __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 = 2577; __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 = 2577; __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 = 2577; __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":2580
 * 
 * 
 *     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":2584
 *         Deallocate memory allocated
 *         """
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2585
 *         """
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 * 
 */
    fmi1_import_terminate(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":2586
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             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_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2588
 *             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":2589
 * 
 *         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_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2591
 *             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":2592
 * 
 *         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_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":2594
 *             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":2595
 * 
 *         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.callbacks), __pyx_v_self->__pyx_base._fmu_temp_dir);

    /* "pyfmi\fmi.pyx":2596
 *         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":2597
 *             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":2599
 *             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":2600
 * 
 *         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":2602
 *             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._fmu_log_name != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2603
 * 
 *         if self._fmu_log_name != NULL:
 *             FMIL.free(self._fmu_log_name)             # <<<<<<<<<<<<<<
 *             self._fmu_log_name = NULL
 * 
 */
    free(__pyx_v_self->__pyx_base._fmu_log_name);

    /* "pyfmi\fmi.pyx":2604
 *         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._fmu_log_name = NULL;
    goto __pyx_L8;
  }
  __pyx_L8:;

  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":2606
 *             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 = 2606; __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 = 2606; __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":2607
 * 
 *     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":2606
 *             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_vtab)->_get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2606; __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":2609
 *         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 = 2609; __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 = 2609; __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 = 2609; __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 = 2609; __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":2611
 *     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 = 2611; __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":2613
 *         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":2615
 *         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":2616
 * 
 *         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 = 2616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_147), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __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 = 2616; __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 = 2609; __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":2609
 *         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_vtab)->_set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2609; __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":2624
 *     """)
 * 
 *     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":2626
 *     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 = 2626; __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 = 2626; __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 = 2626; __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 = 2626; __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 = 2626; __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 = 2626; __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 = 2626; __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 = 2626; __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 = 2626; __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 = 2626; __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 = 2626; __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":2627
 *         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":2629
 *         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":2630
 * 
 *         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 = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_149), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __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 = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2632
 *             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 = 2634; __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":2634
 *         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 = 2634; __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":2636
 *     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 = 2636; __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":2638
 *         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 = 2638; __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 = 2638; __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 = 2638; __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 = 2638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2639
 * 
 *         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 = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_151), NULL); 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_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 = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2644
 *                 '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":2646
 *         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":2647
 * 
 *         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 = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_153), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __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 = 2647; __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":2656
 *     """)
 * 
 *     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":2658
 *     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 = 2658; __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 = 2658; __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 = 2658; __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 = 2658; __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 = 2658; __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 = 2658; __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 = 2658; __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 = 2658; __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 = 2658; __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 = 2658; __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 = 2658; __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":2661
 * 
 *         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":2663
 *                 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":2664
 * 
 *         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 = 2664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_155), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2664; __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 = 2664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2666
 *             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":2674
 *     """)
 * 
 *     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 = 2674; __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 = 2674; __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":2690
 *         """
 *         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 = 2690; __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 = 2690; __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 = 2690; __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 = 2690; __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 = 2690; __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 = 2690; __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 = 2690; __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 = 2690; __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 = 2690; __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 = 2690; __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 = 2690; __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":2692
 *         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":2694
 *         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":2695
 * 
 *         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 = 2695; __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 = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_156), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __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 = 2695; __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 = 2695; __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 = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2697
 *             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":2674
 *     """)
 * 
 *     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_vtab)->get_derivatives(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2674; __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":2699
 *         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":2715
 *         """
 *         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 = 2715; __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 = 2715; __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 = 2715; __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 = 2715; __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 = 2715; __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 = 2715; __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 = 2715; __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 = 2715; __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 = 2715; __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 = 2715; __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 = 2715; __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":2717
 *         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":2719
 *         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":2720
 * 
 *         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 = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_158), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __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 = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2722
 *             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":2725
 * 
 * 
 *     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":2746
 *         """
 *         #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_159); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __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 = 2746; __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":2747
 *         #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 = 2747; __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 = 2747; __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_160); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2747; __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 = 2747; __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":2749
 *         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 = 2749; __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_161;
    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 = 2751; __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 = 2751; __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":2751
 *         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":2774
 *         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 = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2775
 * 
 *         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":2776
 *         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":2778
 *             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":2779
 *         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":2781
 *             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":2782
 * 
 *         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 = 2782; __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 = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_162), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __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 = 2782; __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 = 2782; __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 = 2782; __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":2784
 *             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":2816
 *         """
 * 
 *         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 = 2816; __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 = 2816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2817
 * 
 *         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 = 2817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_163, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2818
 *         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 = 2818; __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 = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2819
 *         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 = 2819; __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 = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2820
 *         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 = 2820; __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 = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2821
 *         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 = 2821; __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 = 2821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2823
 *         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":2825
 *         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":2841
 *         """
 *         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 = 2841; __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 = 2841; __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 = 2841; __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 = 2841; __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 = 2841; __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 = 2841; __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 = 2841; __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 = 2841; __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 = 2841; __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 = 2841; __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 = 2841; __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":2844
 * 
 *         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":2846
 *             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":2847
 * 
 *         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 = 2847; __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 = 2847; __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 = 2847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2850
 *                 '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":2852
 *         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":2868
 *         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":2870
 *         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":2871
 * 
 *         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 = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_167), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __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 = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2873
 *             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":2874
 * 
 *         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 = 2874; __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":2876
 *             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 = 2876; __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_168;

    /* "pyfmi\fmi.pyx":2879
 * 
 * 
 *     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 = 2879; __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 = 2879; __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":2901
 * 
 *         #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 = 2901; __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 = 2901; __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 = 2901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2902
 *         #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 = 2902; __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 = 2902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2904
 *             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 = 2904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2905
 * 
 *         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":2906
 *         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 = 2906; __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 = 2906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":2907
 *             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":2909
 *                 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 = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_tolerance = __pyx_t_4;
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2911
 *                 tolerance = relativeTolerance
 *         else:
 *             tolerance_controlled = 0             # <<<<<<<<<<<<<<
 *             tolerance = 0.0
 * 
 */
    __pyx_v_tolerance_controlled = 0;

    /* "pyfmi\fmi.pyx":2912
 *         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":2914
 *             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":2916
 *         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":2917
 * 
 *         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 = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":2918
 *         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 = 2918; __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 = 2918; __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_170), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2918; __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":2922
 *                     ' 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 = 2922; __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 = 2922; __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_172), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2922; __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":2925
 *                     ' 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":2926
 * 
 *         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 = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":2927
 *         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 = 2927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_174), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2927; __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 = 2927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":2931
 *                     ' 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 = 2931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_176), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2931; __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 = 2931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L9:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":2934
 *                     ' 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_177;
    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 = 2937; __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 = 2937; __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":2937
 * 
 * 
 *     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":2956
 *         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 = 2956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

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

    /* "pyfmi\fmi.pyx":2959
 *             log = 1
 *         else:
 *             log = 0             # <<<<<<<<<<<<<<
 * 
 *         name = encode(name)
 */
    __pyx_v_log = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2961
 *             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 = 2961; __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 = 2961; __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 = 2961; __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":2962
 * 
 *         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 = 2962; __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":2964
 *         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":2965
 * 
 *         if status != 0:
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *         #Just to be safe, some problems with Dymola (2012) FMUs not reacting
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_179), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2965; __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 = 2965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2969
 *         #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":2971
 *         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":2972
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_180), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2972; __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 = 2972; __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":2977
 *                  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_181;
    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 = 2974; __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 = 2974; __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":2974
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')
 * 
 *     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":3041
 *             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 = 3041; __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 = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3042
 *         """
 *         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_119); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3042; __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 = 3042; __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":3043
 *         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 = 3043; __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 = 3043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3044
 *             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_120); 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_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __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":3046
 *             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_121); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyfmi\fmi.pyx":3051
 *                                              '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 = 3046; __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_95));
  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __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 = 3046; __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 = 3053; __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 = 3053; __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":3053
 *                                              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":3070
 *             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 = 3070; __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 = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_95));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __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 = 3070; __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":3072
 *         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
  __Pyx_RefNannySetupContext("terminate", 0);

  /* "pyfmi\fmi.pyx":3077
 *         After this call, any call to a function changing the state of the FMU will fail.
 *         """
 *         FMIL.fmi1_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  fmi1_import_terminate(__pyx_v_self->__pyx_base._fmu);

  __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_15);

    /* "pyfmi\fmi.pyx":3085
 *     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_7);
    values[4] = __pyx_k_182;
    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 = 3085; __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 = 3085; __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":3118
 * 
 *         #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 = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->_log);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_log));
  __pyx_v_self->_log = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3119
 *         #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":3120
 *         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 = 3120; __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":3123
 * 
 *         #Used for deallocation
 *         self._allocated_context = 0             # <<<<<<<<<<<<<<
 *         self._allocated_dll = 0
 *         self._allocated_xml = 0
 */
  __pyx_v_self->_allocated_context = 0;

  /* "pyfmi\fmi.pyx":3124
 *         #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":3125
 *         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":3126
 *         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":3127
 *         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":3128
 *         self._allocated_fmu = 0
 *         self._fmu_temp_dir = NULL
 *         self._fmu_log_name = NULL             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_v_self->_fmu_log_name = NULL;

  /* "pyfmi\fmi.pyx":3131
 * 
 *         #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":3132
 *         #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":3133
 *         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":3134
 *         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":3135
 *         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":3136
 *         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":3137
 *         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":3138
 *         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":3139
 *         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":3140
 *         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":3141
 *         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->_derivatives_states_dependencies);
  __Pyx_DECREF(__pyx_v_self->_derivatives_states_dependencies);
  __pyx_v_self->_derivatives_states_dependencies = Py_None;

  /* "pyfmi\fmi.pyx":3142
 *         self._inputs_references = None
 *         self._derivatives_states_dependencies = None
 *         self._derivatives_inputs_dependencies = None             # <<<<<<<<<<<<<<
 * 
 *         #Internal values
 */
  __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":3145
 * 
 *         #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 = 3145; __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 = 3145; __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":3148
 * 
 *         #Specify the general callback functions
 *         self.callbacks.malloc           = FMIL.malloc             # <<<<<<<<<<<<<<
 *         self.callbacks.calloc           = FMIL.calloc
 *         self.callbacks.realloc          = FMIL.realloc
 */
  __pyx_v_self->callbacks.malloc = malloc;

  /* "pyfmi\fmi.pyx":3149
 *         #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->callbacks.calloc = calloc;

  /* "pyfmi\fmi.pyx":3150
 *         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->callbacks.realloc = realloc;

  /* "pyfmi\fmi.pyx":3151
 *         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->callbacks.free = free;

  /* "pyfmi\fmi.pyx":3152
 *         self.callbacks.realloc          = FMIL.realloc
 *         self.callbacks.free             = FMIL.free
 *         self.callbacks.logger           = importlogger2             # <<<<<<<<<<<<<<
 *         self.callbacks.context          = <void*> self
 * 
 */
  __pyx_v_self->callbacks.logger = __pyx_f_5pyfmi_3fmi_importlogger2;

  /* "pyfmi\fmi.pyx":3153
 *         self.callbacks.free             = FMIL.free
 *         self.callbacks.logger           = importlogger2
 *         self.callbacks.context          = <void*> self             # <<<<<<<<<<<<<<
 * 
 *         #Specify FMI2 related callbacks
 */
  __pyx_v_self->callbacks.context = ((void *)__pyx_v_self);

  /* "pyfmi\fmi.pyx":3156
 * 
 *         #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":3159
 *         #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":3160
 *         #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":3161
 *         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":3162
 *         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":3164
 *         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 = 3164; __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 = 3164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3165
 * 
 *         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 = 3165; __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 = 3165; __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 = 3165; __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 = 3165; __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 = 3165; __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 = 3165; __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":3166
 *         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 = 3166; __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 = 3166; __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 = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {

        /* "pyfmi\fmi.pyx":3167
 *             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 = 3167; __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":3169
 *                     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 = 3169; __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":3170
 *                 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 = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_self->callbacks.log_level = __pyx_t_6;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3172
 *                 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 = 3172; __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 = 3172; __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 = 3172; __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 = 3172; __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_17), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3172; __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 = 3172; __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 = 3172; __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 = 3172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3174
 *                 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 = 3174; __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 = 3174; __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_183), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3174; __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":3175
 *         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 = 3175; __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->callbacks.log_level = __pyx_t_6;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3178
 * 
 *         # 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 = 3178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_184), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3178; __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 = 3178; __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":3179
 *         # 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 = 3179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_185), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3179; __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 = 3179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":3182
 * 
 *         #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 = 3182; __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 = 3182; __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 = 3182; __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 = 3182; __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 = 3182; __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 = 3182; __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 = 3182; __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 = 3182; __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 = 3182; __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 = 3182; __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 = 3182; __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 = 3182; __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 = 3182; __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":3183
 *         #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 = 3183; __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 = 3183; __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 = 3183; __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 = 3183; __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 = 3183; __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 = 3183; __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":3184
 *         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 = 3184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_187), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3184; __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 = 3184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":3187
 * 
 *         # 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->callbacks));

  /* "pyfmi\fmi.pyx":3188
 *         # 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":3191
 * 
 *         #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 = 3191; __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 = 3191; __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 = 3191; __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 = 3191; __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 = 3191; __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":3192
 *         #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 = 3192; __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":3193
 *         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 = 3193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_self->_fmu_temp_dir, __pyx_t_10);

  /* "pyfmi\fmi.pyx":3194
 *         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 = 3194; __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":3197
 * 
 *         #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":3198
 *         #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 = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = PyBytes_FromString(jm_get_last_error((&__pyx_v_self->callbacks))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __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 = 3198; __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 = 3198; __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":3199
 *         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 = 3199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3200
 *             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 = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_24), __pyx_v_last_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __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 = 3200; __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 = 3200; __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 = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3202
 *                 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 = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_188), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __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 = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L9:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":3204
 *                 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":3205
 * 
 *         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 = 3205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = PyBytes_FromString(jm_get_last_error((&__pyx_v_self->callbacks))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3205; __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 = 3205; __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 = 3205; __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":3206
 *         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 = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3207
 *             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 = 3207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_189), __pyx_v_last_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3207; __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 = 3207; __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 = 3207; __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 = 3207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3209
 *                 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 = 3209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_191), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3209; __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 = 3209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L11:;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "pyfmi\fmi.pyx":3212
 * 
 *         #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":3214
 *         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":3215
 * 
 *         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 = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = PyBytes_FromString(jm_get_last_error((&__pyx_v_self->callbacks))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __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 = 3215; __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 = 3215; __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":3216
 *         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 = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3217
 *             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 = 3217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_192), __pyx_v_last_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3217; __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 = 3217; __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 = 3217; __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 = 3217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L13;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3219
 *                 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 = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_194), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __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 = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L13:;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pyfmi\fmi.pyx":3221
 *                 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":3223
 *         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":3224
 *         #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":3227
 * 
 *         #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":3228
 *         #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 = 3228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = PyBytes_FromString(jm_get_last_error((&__pyx_v_self->callbacks))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3228; __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 = 3228; __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 = 3228; __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":3229
 *         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 = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3230
 *             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 = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_195), __pyx_v_last_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __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 = 3230; __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 = 3230; __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 = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L15;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3232
 *                 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 = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_197), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __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 = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L15:;
    goto __pyx_L14;
  }

  /* "pyfmi\fmi.pyx":3233
 *             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":3234
 *                 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":3235
 *         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":3236
 *             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":3237
 *                 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":3239
 *                 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 = 3239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_199), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3239; __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 = 3239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L16:;
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "pyfmi\fmi.pyx":3242
 * 
 *         #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":3243
 *         #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":3244
 *         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 = 3244; __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 = 3244; __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 = 3244; __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 = 3244; __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":3245
 *         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 = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3246
 *             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 = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_200), __pyx_v_last_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __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 = 3246; __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 = 3246; __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 = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L18;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3248
 *                 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 = 3248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_201), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3248; __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 = 3248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L18:;
    goto __pyx_L17;
  }
  __pyx_L17:;

  /* "pyfmi\fmi.pyx":3249
 *             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":3252
 * 
 *         #Load information from model
 *         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 = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = PyBytes_FromString(fmi2_import_get_model_name(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __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 = 3252; __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 = 3252; __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->_modelName);
  __Pyx_DECREF(__pyx_v_self->_modelName);
  __pyx_v_self->_modelName = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3253
 *         #Load information from model
 *         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":3254
 *         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._modelName + "_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":3255
 *         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._modelName + "_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":3256
 *         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._modelName + "_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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyObject_RichCompare(__pyx_v_log_file_name, ((PyObject *)__pyx_kp_s_7), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __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 = 3256; __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->_modelName, ((PyObject *)__pyx_kp_s_36)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __pyx_t_7;
    __pyx_t_7 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_log_file_name);
    __pyx_t_9 = __pyx_v_log_file_name;
  }
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __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 = 3256; __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_log_name = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "pyfmi\fmi.pyx":3257
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)
 *         fmu_log_name = encode((self._modelName + "_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 = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_fmu_log_name = ((char *)malloc(((strlen(__pyx_t_10) + 1) * (sizeof(char)))));

  /* "pyfmi\fmi.pyx":3258
 *         fmu_log_name = encode((self._modelName + "_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 = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_self->_fmu_log_name, __pyx_t_10);

  /* "pyfmi\fmi.pyx":3261
 * 
 *         #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_9 = PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_9));
    __pyx_t_7 = PyTuple_New(2); 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);
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_9));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
    __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_9 = 0;
    __pyx_t_9 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_11 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s____exit__); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s____enter__); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_2);
          __pyx_v_file = __pyx_t_2;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "pyfmi\fmi.pyx":3262
 *         #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_2 = ((PyObject *)__pyx_v_self->_log);
          __Pyx_INCREF(__pyx_t_2);
          if (unlikely(__pyx_t_2 == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          }
          __pyx_t_15 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L23_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_builtin_range, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
          if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
            __pyx_t_9 = __pyx_t_2; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
            __pyx_t_16 = NULL;
          } else {
            __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          for (;;) {
            if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_9)) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
              #else
              __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
              #endif
            } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_9)) {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
              #else
              __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
              #endif
            } else {
              __pyx_t_2 = __pyx_t_16(__pyx_t_9);
              if (unlikely(!__pyx_t_2)) {
                if (PyErr_Occurred()) {
                  if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                  else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L23_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":3263
 *         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_2 = PyObject_GetAttr(__pyx_v_file, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            __Pyx_GOTREF(__pyx_t_2);
            if (unlikely(((PyObject *)__pyx_v_self->_log) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            }
            __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self->_log), __pyx_v_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_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 = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(((PyObject *)__pyx_v_self->_log) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            }
            __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self->_log), __pyx_v_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_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 = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(((PyObject *)__pyx_v_self->_log) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            }
            __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self->_log), __pyx_v_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_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 = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_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 = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_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 = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_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 = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_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_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "pyfmi\fmi.pyx":3264
 *             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 = []             # <<<<<<<<<<<<<<
 * 
 *     def get_real(self, valueref):
 */
          __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
          __Pyx_GOTREF(__pyx_v_self->_log);
          __Pyx_DECREF(((PyObject *)__pyx_v_self->_log));
          __pyx_v_self->_log = ((PyObject*)__pyx_t_9);
          __pyx_t_9 = 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_L30_try_end;
        __pyx_L23_error:;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "pyfmi\fmi.pyx":3261
 * 
 *         #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_9, &__pyx_t_17, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_17);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17);
          __Pyx_GIVEREF(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_7);
          __pyx_t_18 = PyObject_Call(__pyx_t_11, __pyx_t_2, NULL);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L25_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 = 3261; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          __pyx_t_3 = (!__pyx_t_5);
          if (__pyx_t_3) {
            __Pyx_GIVEREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_17);
            __Pyx_GIVEREF(__pyx_t_7);
            __Pyx_ErrRestore(__pyx_t_9, __pyx_t_17, __pyx_t_7);
            __pyx_t_9 = 0; __pyx_t_17 = 0; __pyx_t_7 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
            goto __pyx_L36;
          }
          __pyx_L36:;
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L24_exception_handled;
        }
        __pyx_L25_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_L24_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_L30_try_end:;
      }
    }
    /*finally:*/ {
      if (__pyx_t_11) {
        __pyx_t_14 = PyObject_Call(__pyx_t_11, __pyx_k_tuple_202, NULL);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __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 = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }
    goto __pyx_L37;
    __pyx_L19_error:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L1_error;
    __pyx_L37:;
  }

  __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;
}

/* 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":3266
 *             self._log = []
 * 
 *     def 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) {
  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;
  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_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":3290
 *         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)
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c']            output_value   = 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 = 3290; __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 = 3290; __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 = 3290; __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 = 3290; __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 = 3290; __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 = 3290; __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 = 3290; __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 = 3290; __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 = 3290; __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 = 3290; __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 = 3290; __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 = 3290; __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 = 3290; __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":3291
 * 
 *         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.fmi2_real_t, ndim=1,mode='c']            output_value   = N.array([0.0]*nref,dtype=N.float, ndmin=1)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_input_valueref)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":3292
 *         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.fmi2_real_t, ndim=1,mode='c']            output_value   = N.array([0.0]*nref,dtype=N.float, ndmin=1)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_real(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <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 = 3292; __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 = 3292; __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 = 3292; __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 = 3292; __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 = 3292; __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 = 3292; __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 = 3292; __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 = 3292; __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 = 3292; __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 = 3292; __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 = 3292; __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 = 3292; __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_output_value.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__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 = 3292; __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_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":3294
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c']            output_value   = N.array([0.0]*nref,dtype=N.float, ndmin=1)
 * 
 *         status = FMIL.fmi2_import_get_real(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <FMIL.fmi2_real_t*> output_value.data)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_get_real(__pyx_v_self->_fmu, ((fmi2_value_reference_t *)__pyx_v_input_valueref->data), __pyx_v_nref, ((fmi2_real_t *)__pyx_v_output_value->data));

  /* "pyfmi\fmi.pyx":3296
 *         status = FMIL.fmi2_import_get_real(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <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":3297
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_203), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __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 = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3299
 *             raise FMUException('Failed to get the Real values.')
 * 
 *         return output_value             # <<<<<<<<<<<<<<
 * 
 *     def set_real(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_real", __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_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 = 3301; __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 = 3301; __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 = 3301; __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":3301
 *         return output_value
 * 
 *     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_13FMUModelBase2_4set_real(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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  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;

  /* "pyfmi\fmi.pyx":3322
 *         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()             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c']            set_value      = N.array(values, dtype=N.float, ndmin=1).flatten()
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3322; __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 = 3322; __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 = 3322; __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 = 3322; __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 = 3322; __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 = 3322; __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 = 3322; __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 = 3322; __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 = 3322; __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 = 3322; __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 = 3322; __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 = 3322; __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 = 3322; __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":3323
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).flatten()
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c']            set_value      = N.array(values, dtype=N.float, ndmin=1).flatten()             # <<<<<<<<<<<<<<
 * 
 *         nref = len(input_valueref)
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __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 = 3323; __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 = 3323; __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 = 3323; __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 = 3323; __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 = 3323; __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 = 3323; __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 = 3323; __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 = 3323; __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__flatten); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __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 = 3323; __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 = 3323; __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 = 3323; __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":3325
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c']            set_value      = N.array(values, dtype=N.float, ndmin=1).flatten()
 * 
 *         nref = len(input_valueref)             # <<<<<<<<<<<<<<
 * 
 *         if len(input_valueref) != len(set_value):
 */
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_input_valueref)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":3327
 *         nref = len(input_valueref)
 * 
 *         if len(input_valueref) != len(set_value):             # <<<<<<<<<<<<<<
 *             raise FMUException('The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_input_valueref)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_set_value)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_8 != __pyx_t_9);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":3328
 * 
 *         if len(input_valueref) != len(set_value):
 *             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, nref, <FMIL.fmi2_real_t*> set_value.data)
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_204), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __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 = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3330
 *             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, nref, <FMIL.fmi2_real_t*> set_value.data)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_set_real(__pyx_v_self->_fmu, ((fmi2_value_reference_t *)__pyx_v_input_valueref->data), __pyx_v_nref, ((fmi2_real_t *)__pyx_v_set_value->data));

  /* "pyfmi\fmi.pyx":3332
 *         status = FMIL.fmi2_import_set_real(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <FMIL.fmi2_real_t*> set_value.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Real values.')
 * 
 */
  __pyx_t_10 = (__pyx_v_status != 0);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":3333
 * 
 *         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 = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_205), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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 = 3333; __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 = 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_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":3335
 *             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;
  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_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":3358
 *         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)
 *         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 = 3358; __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 = 3358; __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 = 3358; __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 = 3358; __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 = 3358; __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 = 3358; __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 = 3358; __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 = 3358; __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 = 3358; __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 = 3358; __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 = 3358; __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 = 3358; __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 = 3358; __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":3359
 * 
 *         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.fmi2_integer_t, ndim=1,mode='c']         output_value   = N.array([0]*nref, dtype=int,ndmin=1)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_input_valueref)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":3360
 *         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.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 = 3360; __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 = 3360; __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 = 3360; __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 = 3360; __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 = 3360; __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 = 3360; __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 = 3360; __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 = 3360; __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 = 3360; __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 = 3360; __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 = 3360; __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":3363
 * 
 * 
 *         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":3365
 *         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":3366
 * 
 *         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 = 3366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_206), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3366; __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 = 3366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3368
 *             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 = 3370; __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 = 3370; __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 = 3370; __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":3370
 *         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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  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":3391
 *         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()             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_integer_t, ndim=1,mode='c']         set_value      = N.array(values, dtype=int,ndmin=1).flatten()
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3391; __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 = 3391; __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 = 3391; __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 = 3391; __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 = 3391; __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 = 3391; __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 = 3391; __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 = 3391; __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 = 3391; __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 = 3391; __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 = 3391; __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 = 3391; __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 = 3391; __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":3392
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).flatten()
 *         cdef N.ndarray[FMIL.fmi2_integer_t, ndim=1,mode='c']         set_value      = N.array(values, dtype=int,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 * 
 *         nref = len(input_valueref)
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __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 = 3392; __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 = 3392; __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 = 3392; __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 = 3392; __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 = 3392; __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 = 3392; __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 = 3392; __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__flatten); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __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 = 3392; __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 = 3392; __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 = 3392; __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":3394
 *         cdef N.ndarray[FMIL.fmi2_integer_t, ndim=1,mode='c']         set_value      = N.array(values, dtype=int,ndmin=1).flatten()
 * 
 *         nref = len(input_valueref)             # <<<<<<<<<<<<<<
 * 
 *         if len(input_valueref) != len(set_value):
 */
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_input_valueref)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":3396
 *         nref = len(input_valueref)
 * 
 *         if len(input_valueref) != len(set_value):             # <<<<<<<<<<<<<<
 *             raise FMUException('The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_input_valueref)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_set_value)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_8 != __pyx_t_9);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":3397
 * 
 *         if len(input_valueref) != len(set_value):
 *             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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_207), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __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 = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3399
 *             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":3401
 *         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_10 = (__pyx_v_status != 0);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":3402
 * 
 *         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 = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_208), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __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 = 3402; __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":3404
 *             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;
  Py_ssize_t __pyx_t_7;
  size_t __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  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":3427
 *         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 = 3427; __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 = 3427; __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 = 3427; __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 = 3427; __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 = 3427; __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 = 3427; __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 = 3427; __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 = 3427; __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 = 3427; __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 = 3427; __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 = 3427; __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 = 3427; __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 = 3427; __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":3428
 * 
 *         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)
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_input_valueref)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":3431
 * 
 *         #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":3435
 * 
 *         #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":3437
 *         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 = 3437; __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":3438
 * 
 *         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_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":3439
 *         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 = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = PyList_Append(__pyx_v_return_values, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "pyfmi\fmi.pyx":3445
 * 
 *         #Dealloc
 *         FMIL.free(output_value)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  free(__pyx_v_output_value);

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

    /* "pyfmi\fmi.pyx":3448
 * 
 *         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 = 3448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_209), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3448; __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 = 3448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":3451
 * 
 *         #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 = 3451; __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 = 3451; __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 = 3451; __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 = 3451; __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 = 3453; __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 = 3453; __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 = 3453; __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":3453
 *         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":3474
 *         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 = 3474; __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 = 3474; __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 = 3474; __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 = 3474; __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 = 3474; __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 = 3474; __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 = 3474; __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 = 3474; __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 = 3474; __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 = 3474; __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 = 3474; __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 = 3474; __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 = 3474; __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":3475
 * 
 *         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 = 3475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":3478
 * 
 *         #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).flatten()
 */
  __pyx_v_set_value = malloc(((sizeof(fmi2_boolean_t)) * __pyx_v_nref));

  /* "pyfmi\fmi.pyx":3480
 *         cdef void* set_value = FMIL.malloc(sizeof(FMIL.fmi2_boolean_t)*nref)
 * 
 *         values = N.array(values,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *         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 = 3480; __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 = 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 = PyTuple_New(1); 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_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 = 3480; __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 = 3480; __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 = 3480; __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__flatten); 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_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 = 3480; __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":3481
 * 
 *         values = N.array(values,ndmin=1).flatten()
 *         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":3482
 *         values = N.array(values,ndmin=1).flatten()
 *         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 = 3482; __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 = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":3484
 *             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":3487
 *             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":3489
 *                 (<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 = 3489; __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 = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_7 != __pyx_t_11);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":3490
 * 
 *         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 = 3490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_210), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3490; __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 = 3490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":3493
 * 
 *         #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":3495
 *         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":3497
 *         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":3498
 * 
 *         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 = 3498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_211), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3498; __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 = 3498; __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":3500
 *             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(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_string", 0);

  /* "pyfmi\fmi.pyx":3521
 *         """
 * 
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 *         cdef int         status
 *         cdef FMIL.size_t nref
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3521; __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.FMUModelBase2.get_string", __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_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) {
  CYTHON_UNUSED PyObject *__pyx_v_valueref = 0;
  CYTHON_UNUSED 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 = 3537; __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 = 3537; __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 = 3537; __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":3537
 *         return output_value
 * 
 *     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(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref, CYTHON_UNUSED PyObject *__pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_string", 0);

  /* "pyfmi\fmi.pyx":3555
 *         Calls the low-level FMI function: fmi2SetString
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 *         cdef int         status
 *         cdef FMIL.size_t nref
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3555; __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.FMUModelBase2.set_string", __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_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 = 3572; __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 = 3572; __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 = 3572; __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":3572
 *             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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set", 0);

  /* "pyfmi\fmi.pyx":3579
 *         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_vtab)->get_variable_valueref(__pyx_v_self, __pyx_v_variable_name, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ref = __pyx_t_1;

  /* "pyfmi\fmi.pyx":3580
 * 
 *         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_vtab)->get_variable_data_type(__pyx_v_self, __pyx_v_variable_name, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_type = __pyx_t_2;

  /* "pyfmi\fmi.pyx":3582
 *         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: #INTEGER
 */
  __pyx_t_3 = (__pyx_v_type == fmi2_base_type_real);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3583
 * 
 *         if type == FMIL.fmi2_base_type_real:  #REAL
 *             self.set_real([ref], [value])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi2_base_type_int: #INTEGER
 *             self.set_integer([ref], [value])
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_real); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __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 = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_6, 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 = 3583; __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_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __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_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_6 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __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_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3584
 *         if type == FMIL.fmi2_base_type_real:  #REAL
 *             self.set_real([ref], [value])
 *         elif type == FMIL.fmi2_base_type_int: #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) {

    /* "pyfmi\fmi.pyx":3585
 *             self.set_real([ref], [value])
 *         elif type == FMIL.fmi2_base_type_int: #INTEGER
 *             self.set_integer([ref], [value])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi2_base_type_str: #STRING
 *             self.set_string([ref], [value])
 */
    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_integer); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
    __Pyx_GIVEREF(__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 = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_7, 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 = 3585; __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_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __pyx_t_4 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3586
 *         elif type == FMIL.fmi2_base_type_int: #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_3 = (__pyx_v_type == fmi2_base_type_str);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3587
 *             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_7 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_string); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyList_SET_ITEM(__pyx_t_5, 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 = 3587; __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_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __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));
    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __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(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3588
 *         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_3 = (__pyx_v_type == fmi2_base_type_bool);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3589
 *             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_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_boolean); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __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 = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyList_SET_ITEM(__pyx_t_7, 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 = 3589; __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_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_7 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __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_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3591
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     def _get(self, variable_name):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_212), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3591; __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 = 3591; __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_7);
  __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":3593
 *             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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get", 0);

  /* "pyfmi\fmi.pyx":3600
 *         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_vtab)->get_variable_valueref(__pyx_v_self, __pyx_v_variable_name, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ref = __pyx_t_1;

  /* "pyfmi\fmi.pyx":3601
 * 
 *         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_vtab)->get_variable_data_type(__pyx_v_self, __pyx_v_variable_name, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_type = __pyx_t_2;

  /* "pyfmi\fmi.pyx":3603
 *         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: #INTEGER
 */
  __pyx_t_3 = (__pyx_v_type == fmi2_base_type_real);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3604
 * 
 *         if type == FMIL.fmi2_base_type_real:  #REAL
 *             return self.get_real([ref])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi2_base_type_int: #INTEGER
 *             return self.get_integer([ref])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_real); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __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 = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_6, 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 = 3604; __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 = 3604; __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_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3605
 *         if type == FMIL.fmi2_base_type_real:  #REAL
 *             return self.get_real([ref])
 *         elif type == FMIL.fmi2_base_type_int: #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) {

    /* "pyfmi\fmi.pyx":3606
 *             return self.get_real([ref])
 *         elif type == FMIL.fmi2_base_type_int: #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_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_integer); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __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 = 3606; __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 = 3606; __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_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __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_5)); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3607
 *         elif type == FMIL.fmi2_base_type_int: #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_3 = (__pyx_v_type == fmi2_base_type_str);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3608
 *             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_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_string); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3608; __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 = 3608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_6, 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 = 3608; __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 = 3608; __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_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3609
 *         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_3 = (__pyx_v_type == fmi2_base_type_bool);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3610
 *             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_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_boolean); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); 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_t_4 = PyList_New(1); 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);
    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 = 3610; __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_6, ((PyObject *)__pyx_t_5), NULL); 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_DECREF(__pyx_t_6); __pyx_t_6 = 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;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3612
 *             return self.get_boolean([ref])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_213), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __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 = 3612; __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_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;
}

/* "pyfmi\fmi.pyx":3614
 *             raise FMUException('Type not supported.')
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message):             # <<<<<<<<<<<<<<
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:
 */

static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2__logger(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__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;
  __Pyx_RefNannySetupContext("_logger", 0);

  /* "pyfmi\fmi.pyx":3615
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string 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":3616
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string 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 = 3616; __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 = 3616; __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 = 3616; __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 = 3616; __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 = 3616; __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 = 3616; __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":3617
 *         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 = 3617; __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 = 3617; __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 = 3617; __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 = 3617; __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 = 3617; __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 = 3617; __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 = 3617; __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 = 3617; __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":3616
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string 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.FMUModelBase2._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 = 3616; __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 = 3616; __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 = 3616; __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 = 3616; __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 = 3616; __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_214, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3616; __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 = 3616; __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":3619
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 *             self._log.append([module,log_level,message])             # <<<<<<<<<<<<<<
 * 
 *     def get_log(self):
 */
    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 = 3619; __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 = 3619; __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 = 3619; __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 = 3619; __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 = 3619; __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 = 3619; __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.FMUModelBase2._logger", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23get_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_22get_log[] = "\n        Returns the log information as a list. To turn on the logging use the\n        method, set_debug_logging(True) in the instantiation,\n        FMUModel(..., enable_logging=True). The log is stored as a list of lists.\n        For example log[0] are the first log message to the log and consists of,\n        in the following order, the instance name, the status, the category and\n        the message.\n\n        Returns::\n\n            log - A list of lists.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23get_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_log (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_22get_log(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3621
 *             self._log.append([module,log_level,message])
 * 
 *     def get_log(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the log information as a list. To turn on the logging use the
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_22get_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  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;
  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;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_log", 0);

  /* "pyfmi\fmi.pyx":3634
 *             log - A list of lists.
 *         """
 *         log = []             # <<<<<<<<<<<<<<
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __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":3635
 *         """
 *         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":3636
 *         log = []
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     line = file.readline()
 */
    /*with:*/ {
      __pyx_t_1 = PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3636; __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 = 3636; __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__r));
      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__r));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r));
      __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 = 3636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3636; __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 = 3636; __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_1); __pyx_t_1 = 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":3637
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:
 *                 while True:             # <<<<<<<<<<<<<<
 *                     line = file.readline()
 *                     if line == "":
 */
            while (1) {
              if (!1) break;

              /* "pyfmi\fmi.pyx":3638
 *             with open(self._fmu_log_name,'r') as file:
 *                 while True:
 *                     line = file.readline()             # <<<<<<<<<<<<<<
 *                     if line == "":
 *                         break
 */
              __pyx_t_5 = PyObject_GetAttr(__pyx_v_file, __pyx_n_s__readline); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3638; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3638; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_v_line);
              __pyx_v_line = __pyx_t_1;
              __pyx_t_1 = 0;

              /* "pyfmi\fmi.pyx":3639
 *                 while True:
 *                     line = file.readline()
 *                     if line == "":             # <<<<<<<<<<<<<<
 *                         break
 *                     log.append(line.strip("\n"))
 */
              __pyx_t_1 = PyObject_RichCompare(__pyx_v_line, ((PyObject *)__pyx_kp_s_7), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (__pyx_t_2) {

                /* "pyfmi\fmi.pyx":3640
 *                     line = file.readline()
 *                     if line == "":
 *                         break             # <<<<<<<<<<<<<<
 *                     log.append(line.strip("\n"))
 *         return log
 */
                goto __pyx_L18_break;
                goto __pyx_L19;
              }
              __pyx_L19:;

              /* "pyfmi\fmi.pyx":3641
 *                     if line == "":
 *                         break
 *                     log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 *         return log
 * 
 */
              __pyx_t_1 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3641; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_215), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3641; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_9 = PyList_Append(__pyx_v_log, __pyx_t_5); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3641; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            }
            __pyx_L18_break:;
          }
          __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_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "pyfmi\fmi.pyx":3636
 *         log = []
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     line = file.readline()
 */
          /*except:*/ {
            __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_log", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3636; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3636; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            __pyx_t_11 = PyObject_Call(__pyx_t_4, __pyx_t_10, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3636; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3636; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __pyx_t_12 = (!__pyx_t_2);
            if (__pyx_t_12) {
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_3);
              __Pyx_ErrRestore(__pyx_t_5, __pyx_t_1, __pyx_t_3);
              __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3636; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
              goto __pyx_L22;
            }
            __pyx_L22:;
            __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_216, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3636; __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 = 3636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
      }
      goto __pyx_L23;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L23:;
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3642
 *                         break
 *                     log.append(line.strip("\n"))
 *         return log             # <<<<<<<<<<<<<<
 * 
 *     def print_log(self):
 */
  __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_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.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;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_25print_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_24print_log[] = "\n        Prints the log information to the prompt.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_25print_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_log (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24print_log(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3644
 *         return log
 * 
 *     def print_log(self):             # <<<<<<<<<<<<<<
 *         """
 *         Prints the log information to the prompt.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24print_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  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;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_log", 0);

  /* "pyfmi\fmi.pyx":3649
 *         """
 *         cdef int N
 *         log = self.get_log()             # <<<<<<<<<<<<<<
 *         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 = 3649; __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 = 3649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_log = __pyx_t_2;
  __pyx_t_2 = 0;

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

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

    /* "pyfmi\fmi.pyx":3653
 * 
 *         for i in range(N):
 *             print log[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_log, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __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_AddTraceback("pyfmi.fmi.FMUModelBase2.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_13FMUModelBase2_27instantiate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_26instantiate[] = "\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_27instantiate(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_217;
    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 = 3656; __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 = 3656; __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_26instantiate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_name, __pyx_v_visible);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3656
 * 
 * 
 *     def instantiate(self, name= 'Model', visible = False):             # <<<<<<<<<<<<<<
 *         """
 *         Instantiate the model.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_26instantiate(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":3677
 *         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 = 3677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3678
 * 
 *         if visible:
 *             vis = 1             # <<<<<<<<<<<<<<
 *         else:
 *             vis = 0
 */
    __pyx_v_vis = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3680
 *             vis = 1
 *         else:
 *             vis = 0             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(self,FMUModelME2):
 */
    __pyx_v_vis = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3682
 *             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":3683
 * 
 *         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 = 3683; __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":3684
 *         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":3685
 *             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 = 3685; __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":3687
 *             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 = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_219), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __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 = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":3689
 *             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 = 3689; __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 = 3689; __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 = 3689; __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":3690
 * 
 *         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 = 3690; __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 = 3690; __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":3692
 *         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":3693
 * 
 *         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 = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_220), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __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 = 3693; __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_29setup_experiment(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_28setup_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_29setup_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_221;
    values[1] = ((PyObject *)__pyx_n_s__Default);
    values[2] = ((PyObject *)__pyx_n_s__Default);
    values[3] = __pyx_k_222;
    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 = 3695; __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 = 3695; __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_28setup_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":3695
 *             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_28setup_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":3710
 *         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 = 3710; __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 = 3710; __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 = 3710; __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 = 3710; __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":3711
 * 
 *         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 = 3711; __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 = 3711; __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 = 3711; __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 = 3711; __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":3713
 *         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 = 3713; __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 = 3713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3714
 * 
 *         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_159); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3714; __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 = 3714; __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":3715
 *         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 = 3715; __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 = 3715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3716
 *             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_119); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3716; __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 = 3716; __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":3717
 *         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 = 3717; __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 = 3717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3718
 *             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_120); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3718; __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 = 3718; __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":3720
 *             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":3723
 * 
 *         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 = 3723; __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 = 3723; __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 = 3723; __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":3725
 *                 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":3726
 * 
 *         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 = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_224), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __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 = 3726; __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_31reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_30reset[] = "\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_31reset(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_30reset(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3728
 *             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_30reset(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":3735
 *         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":3736
 * 
 *         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":3737
 *         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 = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_226), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __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 = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3740
 * 
 *         #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":3743
 * 
 *         #Reseting the allocation flags
 *         self._allocated_fmu = 0             # <<<<<<<<<<<<<<
 * 
 *         #Internal values
 */
  __pyx_v_self->_allocated_fmu = 0;

  /* "pyfmi\fmi.pyx":3746
 * 
 *         #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 = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_GOTREF(__pyx_v_self->_log);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_log));
  __pyx_v_self->_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_33terminate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_32terminate[] = "\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_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_13FMUModelBase2_32terminate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3748
 *         self._log = []
 * 
 *     def terminate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the FMI function fmi2Terminate() on the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_32terminate(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("terminate", 0);

  /* "pyfmi\fmi.pyx":3753
 *         After this call, any call to a function changing the state of the FMU will fail.
 *         """
 *         FMIL.fmi2_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def exit_initialization_mode(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_35exit_initialization_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_34exit_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_35exit_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_34exit_initialization_mode(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3755
 *         FMIL.fmi2_import_terminate(self._fmu)
 * 
 *     def exit_initialization_mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Exit initialization mode by calling the low level FMI function
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_34exit_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":3763
 *         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":3765
 *         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":3766
 * 
 *         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 = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":3767
 *         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 = 3767; __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 = 3767; __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_228), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3767; __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":3771
 *                     ' 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 = 3771; __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 = 3771; __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_230), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3771; __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":3774
 *                     ' 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":3775
 * 
 *         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 = 3775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":3776
 *         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 = 3776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_232), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3776; __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 = 3776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3780
 *                     ' 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 = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_234), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3780; __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 = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":3784
 * 
 * 
 *         self._allocated_fmu = 1             # <<<<<<<<<<<<<<
 * 
 *         return status
 */
  __pyx_v_self->_allocated_fmu = 1;

  /* "pyfmi\fmi.pyx":3786
 *         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 = 3786; __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_37enter_initialization_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_36enter_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_37enter_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_36enter_initialization_mode(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3789
 * 
 * 
 *     def enter_initialization_mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Enters initialization mode by calling the low level FMI function
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_36enter_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":3797
 *         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 = 3797; __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 = 3797; __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 = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3798
 *         """
 *         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 = 3798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_236), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3798; __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 = 3798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3800
 *             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":3802
 *         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":3803
 * 
 *         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 = 3803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":3804
 *         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 = 3804; __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 = 3804; __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_238), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3804; __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":3808
 *                     ' 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 = 3808; __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 = 3808; __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_240), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3808; __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":3811
 *                     ' 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":3812
 * 
 *         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 = 3812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":3813
 *         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 = 3813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_242), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3813; __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 = 3813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3817
 *                     ' 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 = 3817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_244), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3817; __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 = 3817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":3820
 *                     ' 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 = 3820; __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_39initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_38initialize[] = "\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_39initialize(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_38initialize(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3822
 *         return status
 * 
 *     def initialize(self):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the model and computes initial values for all variables.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_38initialize(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":3829
 *                                            fmi2ExitInitializationMode
 *         """
 *         self.enter_initialization_mode()             # <<<<<<<<<<<<<<
 *         self.exit_initialization_mode()
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_245); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3829; __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 = 3829; __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":3830
 *         """
 *         self.enter_initialization_mode()
 *         self.exit_initialization_mode()             # <<<<<<<<<<<<<<
 * 
 *     def set_fmil_log_level(self, level):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_246); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __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 = 3830; __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_41set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_v_level); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_40set_fmil_log_level[] = "\n        Specifies the log level for FMI Library. 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_13FMUModelBase2_41set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_v_level) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_fmil_log_level (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_40set_fmil_log_level(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_level));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3832
 *         self.exit_initialization_mode()
 * 
 *     def set_fmil_log_level(self, level):             # <<<<<<<<<<<<<<
 *         """
 *         Specifies the log level for FMI Library. Note that this is
 */

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

  /* "pyfmi\fmi.pyx":3851
 *                     ALL = 7
 *         """
 *         if level < 0 or level > 7:             # <<<<<<<<<<<<<<
 *             raise FMUException("Invalid log level for FMI Library (0-7).")
 *         self.callbacks.log_level = <FMIL.jm_log_level_enu_t> level
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_level, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3851; __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 = 3851; __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_level, __pyx_int_7, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3851; __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 = 3851; __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":3852
 *         """
 *         if level < 0 or level > 7:
 *             raise FMUException("Invalid log level for FMI Library (0-7).")             # <<<<<<<<<<<<<<
 *         self.callbacks.log_level = <FMIL.jm_log_level_enu_t> level
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_247), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3852; __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 = 3852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3853
 *         if level < 0 or level > 7:
 *             raise FMUException("Invalid log level for FMI Library (0-7).")
 *         self.callbacks.log_level = <FMIL.jm_log_level_enu_t> level             # <<<<<<<<<<<<<<
 * 
 *     def get_fmil_log_level(self):
 */
  __pyx_t_6 = ((jm_log_level_enu_t)PyInt_AsLong(__pyx_v_level)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->callbacks.log_level = ((jm_log_level_enu_t)__pyx_t_6);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __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_43get_fmil_log_level(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_42get_fmil_log_level[] = "\n        Returns::\n\n            The current fmil log-level.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_43get_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_42get_fmil_log_level(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3855
 *         self.callbacks.log_level = <FMIL.jm_log_level_enu_t> level
 * 
 *     def get_fmil_log_level(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns::
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_42get_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":3864
 *         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 = 3864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3865
 * 
 *         if self._enable_logging:
 *             level = self.callbacks.log_level             # <<<<<<<<<<<<<<
 *             return level
 *         else:
 */
    __pyx_t_2 = __pyx_v_self->callbacks.log_level;
    __pyx_v_level = __pyx_t_2;

    /* "pyfmi\fmi.pyx":3866
 *         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 = 3866; __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":3868
 *             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 = 3868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_249), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3868; __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 = 3868; __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_45set_debug_logging(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_44set_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_45set_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_250;
    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 = 3870; __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 = 3870; __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_44set_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":3870
 *             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_44set_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":3889
 *         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":3891
 *         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 = 3891; __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->callbacks.log_level = __pyx_t_1;

  /* "pyfmi\fmi.pyx":3893
 *         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 = 3893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

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

    /* "pyfmi\fmi.pyx":3896
 *             log = 1
 *         else:
 *             log = 0             # <<<<<<<<<<<<<<
 * 
 *         self._enable_logging = bool(log)
 */
    __pyx_v_log = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3898
 *             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 = 3898; __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 = 3898; __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 = 3898; __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":3900
 *         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 = 3900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_4 > 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3901
 * 
 *         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 = 3901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_252), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3901; __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 = 3901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":3903
 *             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":3905
 *         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":3906
 * 
 *         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 = 3906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_253), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3906; __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 = 3906; __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_47get_categories(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_46get_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_47get_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_46get_categories(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3908
 *             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_46get_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":3918
 *         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 = 3918; __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 = 3918; __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 = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3919
 * 
 *         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":3920
 *         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 = 3920; __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 = 3920; __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 = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    }

    /* "pyfmi\fmi.pyx":3921
 *             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 = 3921; __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 = 3921; __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":3923
 *             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 = 3923; __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 = 3923; __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":3925
 *             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_49get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_48get_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_49get_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":3928
 * 
 * 
 *     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 = 3928; __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 = 3928; __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_48get_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_48get_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":3949
 *         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 = 3949; __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 = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3950
 * 
 *         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 = 3950; __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":3951
 *         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":3952
 *             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 = 3952; __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 = 3952; __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 = 3952; __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_75), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3952; __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 = 3952; __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 = 3952; __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 = 3952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3953
 *             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 = 3953; __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 = 3953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3954
 *                 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 = 3954; __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 = 3954; __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 = 3954; __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":3955
 *         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 = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_variablename = __pyx_t_6;

    /* "pyfmi\fmi.pyx":3957
 *             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":3958
 * 
 *             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":3959
 *             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 = 3959; __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 = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __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 = 3959; __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 = 3959; __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 = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3961
 *                 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 = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_254), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3961; __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 = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3963
 *             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":3964
 * 
 *         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":3965
 *         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 = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_255), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3965; __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 = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":3967
 *             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 = 3967; __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_51get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_50get_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_51get_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 = 3969; __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 = 3969; __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_50get_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":3969
 *         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_50get_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;
  char *__pyx_v_name;
  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":3992
 *         cdef char* name
 * 
 *         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 = 3992; __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 = 3992; __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":3993
 * 
 *         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":3994
 *         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 = 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 = 3994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_91), __pyx_v_valueref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3994; __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 = 3994; __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 = 3994; __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 = 3994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3996
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)
 * 
 *         name = FMIL.fmi2_import_get_variable_name(variable)             # <<<<<<<<<<<<<<
 * 
 *         return name
 */
  __pyx_v_name = fmi2_import_get_variable_name(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":3998
 *         name = FMIL.fmi2_import_get_variable_name(variable)
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_alias_base(self, char* variablename):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyBytes_FromString(__pyx_v_name); 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_r = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;
  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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_53get_variable_alias_base(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_52get_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_53get_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 = 4000; __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_52get_variable_alias_base(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4000
 *         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_52get_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;
  char *__pyx_v_name;
  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":4017
 *         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":4018
 * 
 *         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":4019
 *         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 = 4019; __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 = 4019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4019; __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 = 4019; __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 = 4019; __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 = 4019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4021
 *             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":4022
 * 
 *         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":4023
 *         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 = 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 = 4023; __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 = 4023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4023; __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 = 4023; __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 = 4023; __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 = 4023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":4025
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         name = FMIL.fmi2_import_get_variable_name(base_variable)             # <<<<<<<<<<<<<<
 * 
 *         return name
 */
  __pyx_v_name = fmi2_import_get_variable_name(__pyx_v_base_variable);

  /* "pyfmi\fmi.pyx":4027
 *         name = FMIL.fmi2_import_get_variable_name(base_variable)
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_alias(self, char* variablename):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4027; __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;

  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_55get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_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        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_55get_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 = 4029; __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_54get_variable_alias(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4029
 *         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_54get_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;
  char *__pyx_v_alias_name;
  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":4054
 *         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
 *         cdef char*                               alias_name
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __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":4058
 *         cdef char*                               alias_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":4059
 * 
 *         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":4060
 *         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 = 4060; __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 = 4060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4060; __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 = 4060; __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 = 4060; __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 = 4060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4062
 *             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":4064
 *         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":4067
 * 
 *         #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":4069
 *         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":4071
 *             variable = FMIL.fmi2_import_get_variable(alias_list, i)
 * 
 *             alias_kind = FMIL.fmi2_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             alias_name = FMIL.fmi2_import_get_variable_name(variable)
 * 
 */
    __pyx_v_alias_kind = fmi2_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4072
 * 
 *             alias_kind = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *             alias_name = FMIL.fmi2_import_get_variable_name(variable)             # <<<<<<<<<<<<<<
 * 
 *             ret_values[alias_name] = alias_kind
 */
    __pyx_v_alias_name = fmi2_import_get_variable_name(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4074
 *             alias_name = FMIL.fmi2_import_get_variable_name(variable)
 * 
 *             ret_values[alias_name] = alias_kind             # <<<<<<<<<<<<<<
 * 
 *         #FREE VARIABLE LIST
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_alias_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(((PyObject *)__pyx_v_ret_values), ((PyObject *)__pyx_t_3), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "pyfmi\fmi.pyx":4077
 * 
 *         #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":4079
 *         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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_57get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_56get_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_57get_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":4081
 *         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 = 4081; __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 = 4081; __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_56get_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_56get_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":4107
 *         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 = 4107; __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":4108
 *         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":4109
 *         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 = 4109; __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":4110
 *         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 = 4110; __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":4111
 *         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 = 4111; __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":4113
 *         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":4114
 * 
 *         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":4116
 *         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":4117
 * 
 *         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 = 4117; __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 = 4117; __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 = 4117; __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":4118
 *         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 = 4118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_length_filter = __pyx_t_6;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4120
 *             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":4122
 *         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":4124
 *             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":4125
 * 
 *             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 = 4125; __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 = 4125; __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 = 4125; __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 = 4125; __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":4126
 *             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":4127
 *             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":4128
 *             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":4131
 * 
 * 
 *             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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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 = 4131; __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":4132
 * 
 *             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":4134
 *                 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 = 4134; __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 = 4134; __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 = 4134; __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 = 4134; __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 = 4134; __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 = 4134; __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 = 4134; __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 = 4134; __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 = 4134; __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 = 4134; __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 = 4134; __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 = 4134; __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":4135
 * 
 *             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":4137
 *                 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":4138
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     if re.match(filter_list[j], name):
 *                         break
 */
      __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":4139
 *             if selected_filter:
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4139; __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 = 4139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_v_filter_list)) { __Pyx_RaiseUnboundLocalError("filter_list"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4139; __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 = 4139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4139; __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_INCREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        __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 = 4139; __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_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_2) {

          /* "pyfmi\fmi.pyx":4140
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):
 *                         break             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
          goto __pyx_L10_break;
          goto __pyx_L11;
        }
        __pyx_L11:;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":4142
 *                         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":4144
 *                     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":4145
 *             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":4147
 *                     continue
 * 
 *             if data_type == FMI2_REAL:             # <<<<<<<<<<<<<<
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI2_INTEGER or data_type == FMI2_ENUMERATION:
 */
    __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_REAL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __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_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4148
 * 
 *             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 = 4148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pyfmi\fmi.pyx":4149
 *             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 = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_INTEGER); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __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 = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_ENUMERATION); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __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_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __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":4150
 *                 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 = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "pyfmi\fmi.pyx":4151
 *             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 = 4151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_BOOLEAN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_12) {

      /* "pyfmi\fmi.pyx":4152
 *                 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 = 4152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L15;
    }
    __pyx_L15:;
    __pyx_L4_continue:;
  }

  /* "pyfmi\fmi.pyx":4155
 * 
 *         #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":4157
 *         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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_12) {
    __pyx_t_4 = PyDict_Keys(__pyx_v_real_var_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4157; __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 = 4157; __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(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 4157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_t_4;
    __pyx_t_4 = 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 = 4157; __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 = 4157; __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 = 4157; __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 = 4157; __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 = 4157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
    __pyx_t_4 = __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 = 4157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __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 = 4157; __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 = 4157; __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 = 4157; __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 = 4157; __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 = 4157; __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 = 4157; __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 = 4157; __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_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_5 = 0;
  __pyx_t_4 = 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_59get_model_variables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_58get_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, Input==1,\n                Output==2, Local==3, Unknown==4).\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_59get_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":4160
 * 
 * 
 *     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_256;

    /* "pyfmi\fmi.pyx":4161
 * 
 *     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_257;
    values[5] = __pyx_k_258;

    /* "pyfmi\fmi.pyx":4163
 *                              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 = 4160; __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 = 4160; __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_58get_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":4160
 * 
 * 
 *     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_58get_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_selected_filter;
  int __pyx_v_length_filter;
  PyObject *__pyx_v_variable_dict = NULL;
  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;
  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":4219
 *         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":4220
 *         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":4221
 *         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
 */
  __pyx_v_selected_causality = 0;

  /* "pyfmi\fmi.pyx":4224
 *         cdef int   has_start, is_fixed
 *         cdef int   i
 *         cdef int  selected_filter = 1 if filter else 0             # <<<<<<<<<<<<<<
 *         cdef int  length_filter = 0
 *         variable_dict = OrderedDict()
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4224; __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":4225
 *         cdef int   i
 *         cdef int  selected_filter = 1 if filter else 0
 *         cdef int  length_filter = 0             # <<<<<<<<<<<<<<
 *         variable_dict = OrderedDict()
 * 
 */
  __pyx_v_length_filter = 0;

  /* "pyfmi\fmi.pyx":4226
 *         cdef int  selected_filter = 1 if filter else 0
 *         cdef int  length_filter = 0
 *         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 = 4226; __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 = 4226; __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":4228
 *         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":4229
 * 
 *         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":4231
 *         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 = 4231; __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 = 4231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4232
 * 
 *         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 = 4232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_type = __pyx_t_5;

    /* "pyfmi\fmi.pyx":4233
 *         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":4234
 *             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 = 4234; __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 = 4234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4235
 *             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 = 4235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_causality = __pyx_t_6;

    /* "pyfmi\fmi.pyx":4236
 *         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":4237
 *             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 = 4237; __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 = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4238
 *             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 = 4238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_variability = __pyx_t_7;

    /* "pyfmi\fmi.pyx":4239
 *         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":4240
 *             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":4241
 *             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 = 4241; __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 = 4241; __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 = 4241; __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_v_filter_list = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "pyfmi\fmi.pyx":4242
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
    __pyx_t_9 = PyObject_Length(__pyx_v_filter_list); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_length_filter = __pyx_t_9;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":4244
 *             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":4246
 *         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":4248
 *             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":4249
 * 
 *             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 = 4249; __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 = 4249; __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 = 4249; __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 = 4249; __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":4250
 *             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":4251
 *             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":4252
 *             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":4253
 *             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":4254
 *             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":4255
 *             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":4256
 *             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":4259
 * 
 *             #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 = 4259; __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":4260
 *             #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":4262
 *                 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 = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":4264
 *             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":4265
 *                 #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":4266
 *                 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":4267
 *                     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":4269
 *                     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":4270
 * 
 *             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":4271
 *             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":4272
 *                 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":4273
 *             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":4274
 *                 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":4276
 *                 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":4277
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     if re.match(filter_list[j], name):
 *                         break
 */
      __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":4278
 *             if selected_filter:
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __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 = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_v_filter_list)) { __Pyx_RaiseUnboundLocalError("filter_list"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_filter_list, __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __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_8)); __pyx_t_8 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_13) {

          /* "pyfmi\fmi.pyx":4279
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):
 *                         break             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
          goto __pyx_L17_break;
          goto __pyx_L18;
        }
        __pyx_L18:;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":4281
 *                         break
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if include_alias:
 */
        goto __pyx_L7_continue;
      }
      __pyx_L17_break:;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "pyfmi\fmi.pyx":4283
 *                     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 = 4283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":4286
 *                 #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_3 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      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 = 4286; __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_7));
        __pyx_t_4 = ((PyObject *)__pyx_kp_s_7);
      }

      /* "pyfmi\fmi.pyx":4287
 *                 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 = 4287; __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 = 4287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);

      /* "pyfmi\fmi.pyx":4288
 *                                        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 = 4288; __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 = 4288; __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 = 4285; __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_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      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_3 = 0;
      __pyx_t_8 = 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 = 4285; __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":4285
 *             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 = 4285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      goto __pyx_L19;
    }

    /* "pyfmi\fmi.pyx":4289
 *                                        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":4293
 *                 #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 = 4293; __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 = 4293; __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 = 4293; __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_7));
        __pyx_t_18 = ((PyObject *)__pyx_kp_s_7);
      }

      /* "pyfmi\fmi.pyx":4294
 *                 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 = 4294; __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 = 4294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);

      /* "pyfmi\fmi.pyx":4295
 *                                        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 = 4295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = PyInt_FromLong(__pyx_v_initial); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4292; __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_19);
      __Pyx_GIVEREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_20);
      __Pyx_GIVEREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_18);
      __Pyx_GIVEREF(__pyx_t_18);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __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_8 = 0;
      __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4292
 *                 #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_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L19;
    }
    __pyx_L19:;
    __pyx_L7_continue:;
  }

  /* "pyfmi\fmi.pyx":4298
 * 
 *         #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":4300
 *         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_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_13FMUModelBase2_61get_variable_references(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_60get_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_61get_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_60get_variable_references(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4302
 *         return variable_dict
 * 
 *     def get_variable_references(self):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the value references of all variables. The
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_60get_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":4328
 *             [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":4329
 *         """
 *         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":4330
 *         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":4332
 *         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 = 4332; __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 = 4332; __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 = 4332; __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 = 4332; __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":4333
 * 
 *         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 = 4333; __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 = 4333; __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 = 4333; __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 = 4333; __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 = 4333; __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 = 4333; __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 = 4333; __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 = 4333; __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 = 4333; __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 = 4333; __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 = 4333; __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":4335
 *         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 = 4335; __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 = 4335; __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 = 4335; __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 = 4335; __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":4336
 * 
 *         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 = 4336; __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 = 4336; __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 = 4336; __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 = 4336; __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 = 4336; __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 = 4336; __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 = 4336; __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 = 4336; __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 = 4336; __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 = 4336; __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 = 4336; __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":4338
 *         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 = 4338; __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":4340
 *         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_63get_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_74); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4340; __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_valueref)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4340; __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 = 4340; __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 = 4340; __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":4356
 *         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 = 4356; __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 = 4356; __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 = 4356; __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":4357
 * 
 *         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 = 4357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":4359
 *         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":4360
 * 
 *         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":4361
 *         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 = 4361; __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 = 4361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4361; __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 = 4361; __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 = 4361; __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 = 4361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4362
 *         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":4364
 *         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_63get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_62get_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_63get_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_62get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4340
 *         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_62get_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_vtab)->get_variable_valueref(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4340; __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 = 4340; __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":4366
 *         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_65get_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_73); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4366; __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_data_type)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4366; __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 = 4366; __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 = 4366; __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":4382
 *         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 = 4382; __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 = 4382; __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 = 4382; __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":4383
 * 
 *         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 = 4383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":4385
 *         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":4386
 * 
 *         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":4387
 *         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 = 4387; __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 = 4387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4387; __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 = 4387; __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 = 4387; __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 = 4387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4389
 *             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":4391
 *         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_65get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_64get_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_65get_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_64get_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":4366
 *         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_64get_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_vtab)->get_variable_data_type(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4366; __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 = 4366; __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":4393
 *         return type
 * 
 *     cpdef get_variable_description(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the description of a given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67get_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_72); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4393; __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_description)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4393; __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 = 4393; __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":4409
 *         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 = 4409; __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 = 4409; __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 = 4409; __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":4410
 * 
 *         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 = 4410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":4412
 *         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":4413
 * 
 *         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":4414
 *         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 = 4414; __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 = 4414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4414; __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 = 4414; __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 = 4414; __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 = 4414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4416
 *             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":4418
 *         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 = 4418; __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_7));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
  }
  __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_67get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_66get_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_67get_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_66get_variable_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4393
 *         return type
 * 
 *     cpdef get_variable_description(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the description of a given variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_66get_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_vtab)->get_variable_description(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4393; __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":4420
 *         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_69get_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_90); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4420; __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_variability)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4420; __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 = 4420; __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 = 4420; __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":4437
 *         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 = 4437; __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 = 4437; __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 = 4437; __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":4438
 * 
 *         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 = 4438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":4440
 *         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":4441
 * 
 *         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":4442
 *         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 = 4442; __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 = 4442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4442; __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 = 4442; __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 = 4442; __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 = 4442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4443
 *         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":4445
 *         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_69get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_68get_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_69get_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_68get_variable_variability(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4420
 *         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_68get_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_vtab)->get_variable_variability(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4420; __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 = 4420; __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":4447
 *         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_71get_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_259); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4447; __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_initial)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4447; __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 = 4447; __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 = 4447; __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":4464
 *         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 = 4464; __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 = 4464; __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 = 4464; __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":4465
 * 
 *         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 = 4465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":4467
 *         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":4468
 * 
 *         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":4469
 *         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 = 4469; __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 = 4469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4469; __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 = 4469; __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 = 4469; __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 = 4469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4470
 *         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":4472
 *         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_71get_variable_initial(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_70get_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_71get_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_70get_variable_initial(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4447
 *         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_70get_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_vtab)->get_variable_initial(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4447; __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 = 4447; __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":4474
 *         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_73get_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_92); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4474; __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_causality)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4474; __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 = 4474; __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 = 4474; __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":4491
 *         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 = 4491; __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 = 4491; __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 = 4491; __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":4492
 * 
 *         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 = 4492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":4494
 *         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":4495
 * 
 *         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":4496
 *         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 = 4496; __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 = 4496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4496; __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 = 4496; __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 = 4496; __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 = 4496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4498
 *             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":4500
 *         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_73get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_72get_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), INPUT(1),\n            OUTPUT(2), LOCAL(3), UNKNOWN(4)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73get_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_72get_variable_causality(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4474
 *         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_72get_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_vtab)->get_variable_causality(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4474; __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 = 4474; __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":4502
 *         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_75get_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 = 4502; __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_start)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4502; __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 = 4502; __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":4524
 *         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":4526
 *         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 = 4526; __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 = 4526; __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 = 4526; __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":4527
 * 
 *         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 = 4527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":4529
 *         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":4530
 * 
 *         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":4531
 *         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 = 4531; __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 = 4531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4531; __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 = 4531; __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 = 4531; __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 = 4531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4533
 *             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":4535
 *         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":4536
 * 
 *         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 = 4536; __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 = 4536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_80), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4536; __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 = 4536; __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 = 4536; __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 = 4536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":4538
 *             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":4540
 *         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":4541
 * 
 *         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":4542
 *         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 = 4542; __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":4544
 *             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":4545
 * 
 *         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":4546
 *         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 = 4546; __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":4548
 *             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":4549
 * 
 *         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":4550
 *         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 = 4550; __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":4552
 *             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":4553
 * 
 *         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":4554
 *         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 = 4554; __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":4556
 *             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":4557
 * 
 *         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":4558
 *         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 = 4558; __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":4561
 * 
 *         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 = 4561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_260), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4561; __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 = 4561; __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_75get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_74get_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_75get_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_74get_variable_start(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4502
 *         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_74get_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_vtab)->get_variable_start(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4502; __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":4563
 *             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_77get_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 = 4563; __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_max)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4563; __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 = 4563; __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":4582
 *         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 = 4582; __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 = 4582; __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 = 4582; __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":4583
 * 
 *         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 = 4583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":4585
 *         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":4586
 * 
 *         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":4587
 *         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 = 4587; __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 = 4587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4587; __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 = 4587; __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 = 4587; __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 = 4587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4589
 *             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":4591
 *         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":4592
 * 
 *         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":4593
 *         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 = 4593; __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":4595
 *             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":4596
 * 
 *         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":4597
 *         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 = 4597; __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":4599
 *             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":4600
 * 
 *         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":4601
 *         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 = 4601; __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":4604
 * 
 *         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 = 4604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_261), 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(__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 = 4604; __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_77get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_76get_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_77get_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_76get_variable_max(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4563
 *             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_76get_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_vtab)->get_variable_max(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4563; __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":4606
 *             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_79get_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 = 4606; __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_79get_variable_min)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4606; __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 = 4606; __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":4625
 *         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 = 4625; __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 = 4625; __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 = 4625; __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":4626
 * 
 *         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 = 4626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":4628
 *         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":4629
 * 
 *         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":4630
 *         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 = 4630; __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 = 4630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4630; __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 = 4630; __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 = 4630; __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 = 4630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4632
 *             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":4634
 *         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":4635
 * 
 *         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":4636
 *         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 = 4636; __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":4638
 *             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":4639
 * 
 *         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":4640
 *         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 = 4640; __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":4642
 *             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":4643
 * 
 *         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":4644
 *         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 = 4644; __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":4647
 * 
 *         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 = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_262), 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(__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 = 4647; __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_79get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_78get_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_79get_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_78get_variable_min(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4606
 *             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_78get_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_vtab)->get_variable_min(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4606; __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_81get_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_80get_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_81get_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":4649
 *             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 = 4649; __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 = 4649; __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 = 4649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_80get_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_80get_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":4670
 *         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":4671
 * 
 *         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 = 4671; __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":4673
 *             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_263); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4673; __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 = 4673; __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 = 4673; __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":4674
 * 
 *         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 = 4674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_265), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4674; __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 = 4674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":4676
 *             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":4678
 *         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":4679
 * 
 *         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 = 4679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_267), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4679; __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 = 4679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":4681
 *             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_83set_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_82set_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_83set_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 = 4683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_82set_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":4683
 *         return state
 * 
 *     def set_fmu_state(self, FMUState2 state):             # <<<<<<<<<<<<<<
 *         """
 *         Set the FMU to a previous saved state.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_82set_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":4698
 *         """
 *         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":4700
 *         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_263); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4700; __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 = 4700; __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 = 4700; __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":4701
 * 
 *         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 = 4701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_269), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4701; __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 = 4701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4703
 *             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":4705
 *         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":4706
 * 
 *         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 = 4706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_271), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4706; __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 = 4706; __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_85free_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_84free_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_85free_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 = 4708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_84free_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":4708
 *             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_84free_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":4724
 *         """
 *         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":4726
 *         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_263); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4726; __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 = 4726; __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 = 4726; __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":4727
 * 
 *         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 = 4727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_272), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4727; __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 = 4727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4728
 *         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":4729
 *             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_273)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pyfmi\fmi.pyx":4730
 *         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":4732
 *             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":4734
 *         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":4735
 * 
 *         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 = 4735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_275), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4735; __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 = 4735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":4738
 * 
 *         #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":4740
 *         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_87serialize_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 = 4740; __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_87serialize_fmu_state)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4740; __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 = 4740; __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":4756
 *             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 = 4756; __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_87serialize_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_86serialize_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_87serialize_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_86serialize_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4740
 *         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_86serialize_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_vtab)->serialize_fmu_state(__pyx_v_self, __pyx_v_state, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4740; __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":4780
 *         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_89deserialize_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_276); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4780; __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_89deserialize_fmu_state)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4780; __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 = 4780; __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":4799
 *             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 = 4799; __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_89deserialize_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_serialized_fmu); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_88deserialize_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_89deserialize_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_88deserialize_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_serialized_fmu));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4780
 *         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_88deserialize_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_vtab)->deserialize_fmu_state(__pyx_v_self, __pyx_v_serialized_fmu, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4780; __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":4813
 *         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_91serialized_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_277); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4813; __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_91serialized_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 = 4813; __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 = 4813; __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":4826
 *             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 = 4826; __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_91serialized_fmu_state_size(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_90serialized_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_91serialized_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_90serialized_fmu_state_size(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4813
 *         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_90serialized_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_vtab)->serialized_fmu_state_size(__pyx_v_self, __pyx_v_state, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4813; __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_93get_ode_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_92get_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_93get_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_92get_ode_sizes(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4839
 *         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_92get_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":4856
 *             [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 = 4856; __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 = 4856; __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 = 4856; __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_95get_default_experiment_start_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_94get_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_95get_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_94get_default_experiment_start_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4858
 *         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_94get_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":4863
 *         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 = 4863; __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_97get_default_experiment_stop_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_96get_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_97get_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_96get_default_experiment_stop_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4865
 *         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_96get_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":4870
 *         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 = 4870; __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_99get_default_experiment_tolerance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_98get_default_experiment_tolerance[] = "\n        Returns the default experiment tolerance as defined in the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_99get_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_98get_default_experiment_tolerance(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4872
 *         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_98get_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":4877
 *         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 = 4877; __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_101get_default_experiment_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_100get_default_experiment_step[] = "\n        Returns the default experiment step as defined in the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_101get_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_100get_default_experiment_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4879
 *         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_100get_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":4884
 *         description.
 *         """
 *         return FMIL.fmi2_import_get_default_experiment_step(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def _convert_filter(self, expression):
 */
  __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 = 4884; __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;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_103_convert_filter(PyObject *__pyx_v_self, PyObject *__pyx_v_expression); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_102_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_13FMUModelBase2_103_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_13FMUModelBase2_102_convert_filter(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_expression));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4886
 *         return FMIL.fmi2_import_get_default_experiment_step(self._fmu)
 * 
 *     def _convert_filter(self, expression):             # <<<<<<<<<<<<<<
 *         """
 *         Convert a filter based on unix filename pattern matching to a
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_102_convert_filter(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__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_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_convert_filter", 0);

  /* "pyfmi\fmi.pyx":4900
 *             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 = 4900; __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":4901
 *         """
 *         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":4902
 *         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 = 4902; __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 = 4902; __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 = 4902; __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 = 4902; __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":4903
 *         if isinstance(expression,str):
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]             # <<<<<<<<<<<<<<
 *         elif isinstance(expression,list):
 *             for i in expression:
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4903; __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 = 4903; __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 = 4903; __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 = 4903; __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 = 4903; __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":4904
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):             # <<<<<<<<<<<<<<
 *             for i in expression:
 *                 regex = fnmatch.translate(i)
 */
  __pyx_t_2 = PyList_Check(__pyx_v_expression); 
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4905
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):
 *             for i in expression:             # <<<<<<<<<<<<<<
 *                 regex = fnmatch.translate(i)
 *                 regexp.append(re.compile(regex))
 */
    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 = 4905; __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 = 4905; __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 = 4905; __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 = 4905; __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 = 4905; __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 = 4905; __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":4906
 *         elif isinstance(expression,list):
 *             for i in expression:
 *                 regex = fnmatch.translate(i)             # <<<<<<<<<<<<<<
 *                 regexp.append(re.compile(regex))
 *         else:
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__fnmatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4906; __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 = 4906; __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 = 4906; __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 = 4906; __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_XDECREF(__pyx_v_regex);
      __pyx_v_regex = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "pyfmi\fmi.pyx":4907
 *             for i in expression:
 *                 regex = fnmatch.translate(i)
 *                 regexp.append(re.compile(regex))             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("Unknown input.")
 */
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__compile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __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 = 4907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_regex);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_regex);
      __Pyx_GIVEREF(__pyx_v_regex);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4907; __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_7)); __pyx_t_7 = 0;
      __pyx_t_8 = PyList_Append(__pyx_v_regexp, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4907; __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;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":4909
 *                 regexp.append(re.compile(regex))
 *         else:
 *             raise FMUException("Unknown input.")             # <<<<<<<<<<<<<<
 *         return regexp
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_278), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4909; __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 = 4909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4910
 *         else:
 *             raise FMUException("Unknown input.")
 *         return regexp             # <<<<<<<<<<<<<<
 * 
 *     cdef _add_scalar_variables(self, FMIL.fmi2_import_variable_list_t*   variable_list):
 */
  __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.FMUModelBase2._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;
}

/* "pyfmi\fmi.pyx":4912
 *         return regexp
 * 
 *     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":4917
 *         """
 *         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 = 4917; __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 = 4917; __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":4919
 *         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":4921
 *         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":4923
 *         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":4924
 * 
 *             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_vtab)->_add_scalar_variable(__pyx_v_self, __pyx_v_variable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4924; __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":4925
 *             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 = 4925; __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 = 4925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "pyfmi\fmi.pyx":4927
 *             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":4929
 *         return variable_dict
 * 
 *     cdef _add_scalar_variable(self, FMIL.fmi2_import_variable_t* variable):             # <<<<<<<<<<<<<<
 * 
 *         alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 */

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;
  char *__pyx_v_name;
  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
  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("_add_scalar_variable", 0);

  /* "pyfmi\fmi.pyx":4931
 *     cdef _add_scalar_variable(self, FMIL.fmi2_import_variable_t* variable):
 * 
 *         alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *         name             = FMIL.fmi2_import_get_variable_name(variable)
 *         value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 */
  __pyx_t_1 = PyInt_FromLong(fmi2_import_get_variable_alias_kind(__pyx_v_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_alias_kind = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4932
 * 
 *         alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *         name             = 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_v_name = fmi2_import_get_variable_name(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4933
 *         alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *         name             = 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":4934
 *         name             = 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_1 = PyInt_FromLong(fmi2_import_get_variable_base_type(__pyx_v_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_data_type = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4935
 *         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_1 = PyInt_FromLong(fmi2_import_get_variability(__pyx_v_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_data_variability = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4936
 *         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_1 = PyInt_FromLong(fmi2_import_get_causality(__pyx_v_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_data_causality = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4937
 *         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":4939
 *         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_1 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); 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);
  if ((__pyx_v_desc != NULL)) {
    __pyx_t_4 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_desc, 0, strlen(__pyx_v_desc), NULL, NULL, PyUnicode_DecodeUTF8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_3 = ((PyObject *)__pyx_t_4);
    __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
    __pyx_t_3 = ((PyObject *)__pyx_kp_s_7);
  }

  /* "pyfmi\fmi.pyx":4941
 *         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_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4939; __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);
  __Pyx_INCREF(__pyx_v_data_type);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_data_type);
  __Pyx_GIVEREF(__pyx_v_data_type);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_data_variability);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_data_variability);
  __Pyx_GIVEREF(__pyx_v_data_variability);
  __Pyx_INCREF(__pyx_v_data_causality);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_data_causality);
  __Pyx_GIVEREF(__pyx_v_data_causality);
  __Pyx_INCREF(__pyx_v_alias_kind);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_v_alias_kind);
  __Pyx_GIVEREF(__pyx_v_alias_kind);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 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_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_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_105get_derivatives_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_104get_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_105get_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_104get_derivatives_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4943
 *                                     alias_kind)
 * 
 *     def get_derivatives_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the states derivatives.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_104get_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":4953
 *         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":4954
 * 
 *         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":4955
 *         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 = 4955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_280), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4955; __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 = 4955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4957
 *             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_vtab)->_add_scalar_variables(__pyx_v_self, __pyx_v_variable_list); 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_v_variable_dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4960
 * 
 *         #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":4962
 *         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":4964
 *         return variable_dict
 * 
 *     cpdef get_output_dependencies(self):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieve the list of variables that the outputs are
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_107get_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;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = 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_281); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4964; __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_107get_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 = 4964; __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":4974
 *         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)             # <<<<<<<<<<<<<<
 * 
 *         FMIL.fmi2_import_get_outputs_dependencies(self._fmu, &start_indexp, &dependencyp, &factor_kindp)
 */
  __pyx_v_variable_list = fmi2_import_get_variable_list(__pyx_v_self->_fmu, 0);

  /* "pyfmi\fmi.pyx":4976
 *         cdef FMIL.fmi2_import_variable_list_t *variable_list = FMIL.fmi2_import_get_variable_list(self._fmu, 0)
 * 
 *         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":4978
 *         FMIL.fmi2_import_get_outputs_dependencies(self._fmu, &start_indexp, &dependencyp, &factor_kindp)
 * 
 *         if start_indexp == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("No dependency information for the outputs was found in the model description.")
 * 
 */
  __pyx_t_3 = (__pyx_v_start_indexp == NULL);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":4979
 * 
 *         if start_indexp == NULL:
 *             raise FMUException("No dependency information for the outputs was found in the model description.")             # <<<<<<<<<<<<<<
 * 
 *         if python3_flag:
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_283), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4979; __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 = 4979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4981
 *             raise FMUException("No dependency information for the outputs was found in the model description.")
 * 
 *         if python3_flag:             # <<<<<<<<<<<<<<
 *             outputs = list(self.get_output_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 = 4981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":4982
 * 
 *         if python3_flag:
 *             outputs = list(self.get_output_list().keys())             # <<<<<<<<<<<<<<
 *         else:
 *             outputs = self.get_output_list().keys()
 */
    __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 = 4982; __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 = 4982; __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 = 4982; __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 = 4982; __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(1); 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);
    PyTuple_SET_ITEM(__pyx_t_2, 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_2), NULL); 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_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_outputs = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":4984
 *             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_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 = 4984; __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 = 4984; __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 = 4984; __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 = 4984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_outputs = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":4985
 *         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_states_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4985; __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 = 4985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_states_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4986
 *             outputs = self.get_output_list().keys()
 *         states_list = self.get_states_list()
 *         inputs_list = self.get_input_list()             # <<<<<<<<<<<<<<
 * 
 *         states = OrderedDict()
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_input_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4986; __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 = 4986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_inputs_list = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4988
 *         inputs_list = self.get_input_list()
 * 
 *         states = OrderedDict()             # <<<<<<<<<<<<<<
 *         inputs = OrderedDict()
 *         for i in range(0,len(outputs)):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4988; __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 = 4988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_states = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4989
 * 
 *         states = OrderedDict()
 *         inputs = OrderedDict()             # <<<<<<<<<<<<<<
 *         for i in range(0,len(outputs)):
 *             states[outputs[i]]  = []
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__OrderedDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4989; __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 = 4989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_inputs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4990
 *         states = OrderedDict()
 *         inputs = OrderedDict()
 *         for i in range(0,len(outputs)):             # <<<<<<<<<<<<<<
 *             states[outputs[i]]  = []
 *             inputs[outputs[i]] = []
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_outputs); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4990; __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 = 4990; __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 = 4990; __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_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_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_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_5(__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 = 4990; __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":4991
 *         inputs = OrderedDict()
 *         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 = 4991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_GetItem(__pyx_v_outputs, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (PyObject_SetItem(__pyx_v_states, __pyx_t_6, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":4992
 *         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 = 4992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_GetItem(__pyx_v_outputs, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (PyObject_SetItem(__pyx_v_inputs, __pyx_t_6, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":4994
 *             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 = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyInt_FromSize_t(((__pyx_v_start_indexp[__pyx_t_7]) - (__pyx_v_start_indexp[__pyx_t_8]))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_6)) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_6)) {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_2 = __pyx_t_9(__pyx_t_6);
        if (unlikely(!__pyx_t_2)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __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":4995
 * 
 *             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_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyInt_FromSize_t((__pyx_v_start_indexp[__pyx_t_7])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_v_j); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_3 = ((__pyx_v_dependencyp[__pyx_t_7]) != 0);
      if (__pyx_t_3) {

        /* "pyfmi\fmi.pyx":4996
 *             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_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_10 = __Pyx_PyInt_FromSize_t((__pyx_v_start_indexp[__pyx_t_7])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_2 = PyNumber_Add(__pyx_t_10, __pyx_v_j); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __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_7]) - 1));

        /* "pyfmi\fmi.pyx":4997
 *                 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 = 4997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = PyBytes_FromString(fmi2_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_10));
        __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_t_10));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
        __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_v_name);
        __pyx_v_name = __pyx_t_10;
        __pyx_t_10 = 0;

        /* "pyfmi\fmi.pyx":4999
 *                     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_3 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_states_list, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_3) {

          /* "pyfmi\fmi.pyx":5000
 * 
 *                     if name in states_list:
 *                         states[outputs[i]].append(name)             # <<<<<<<<<<<<<<
 *                     elif name in inputs_list:
 *                         inputs[outputs[i]].append(name)
 */
          __pyx_t_10 = PyObject_GetItem(__pyx_v_outputs, __pyx_v_i); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = PyObject_GetItem(__pyx_v_states, __pyx_t_10); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_11, __pyx_v_name); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L10;
        }

        /* "pyfmi\fmi.pyx":5001
 *                     if name in states_list:
 *                         states[outputs[i]].append(name)
 *                     elif name in inputs_list:             # <<<<<<<<<<<<<<
 *                         inputs[outputs[i]].append(name)
 * 
 */
        __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_inputs_list, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_3) {

          /* "pyfmi\fmi.pyx":5002
 *                         states[outputs[i]].append(name)
 *                     elif name in inputs_list:
 *                         inputs[outputs[i]].append(name)             # <<<<<<<<<<<<<<
 * 
 *         return states, inputs
 */
          __pyx_t_10 = PyObject_GetItem(__pyx_v_outputs, __pyx_v_i); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = PyObject_GetItem(__pyx_v_inputs, __pyx_t_10); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_11, __pyx_v_name); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L10;
        }
        __pyx_L10:;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5004
 *                         inputs[outputs[i]].append(name)
 * 
 *         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 = 5004; __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_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __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_107get_output_dependencies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_106get_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_107get_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_106get_output_dependencies(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4964
 *         return variable_dict
 * 
 *     cpdef get_output_dependencies(self):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieve the list of variables that the outputs are
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_106get_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_vtab)->get_output_dependencies(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4964; __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":5006
 *         return states, inputs
 * 
 *     cpdef get_derivatives_dependencies(self):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieve the list of variables that the derivatives are
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_109get_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_284); 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);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_109get_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 = 5006; __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":5012
 *         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":5013
 *         """
 *         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":5014
 *         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 = 5014; __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":5020
 *         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)             # <<<<<<<<<<<<<<
 * 
 *         FMIL.fmi2_import_get_derivatives_dependencies(self._fmu, &start_indexp, &dependencyp, &factor_kindp)
 */
  __pyx_v_variable_list = fmi2_import_get_variable_list(__pyx_v_self->_fmu, 0);

  /* "pyfmi\fmi.pyx":5022
 *         cdef FMIL.fmi2_import_variable_list_t *variable_list = FMIL.fmi2_import_get_variable_list(self._fmu, 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":5024
 *         FMIL.fmi2_import_get_derivatives_dependencies(self._fmu, &start_indexp, &dependencyp, &factor_kindp)
 * 
 *         if start_indexp == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("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":5025
 * 
 *         if start_indexp == NULL:
 *             raise FMUException("No dependency information for the derivatives was found in the model description.")             # <<<<<<<<<<<<<<
 * 
 *         if python3_flag:
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_286), NULL); 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_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 = 5025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5027
 *             raise FMUException("No dependency information for the derivatives was found in the model description.")
 * 
 *         if python3_flag:             # <<<<<<<<<<<<<<
 *             derivatives = list(self.get_derivatives_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 = 5027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":5028
 * 
 *         if python3_flag:
 *             derivatives = list(self.get_derivatives_list().keys())             # <<<<<<<<<<<<<<
 *         else:
 *             derivatives = self.get_derivatives_list().keys()
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_287); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5028; __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 = 5028; __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 = 5028; __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 = 5028; __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(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5028; __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(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_derivatives = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5030
 *             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_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_287); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5030; __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 = 5030; __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 = 5030; __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 = 5030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_derivatives = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5031
 *         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__get_states_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5031; __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 = 5031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_states_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5032
 *             derivatives = self.get_derivatives_list().keys()
 *         states_list = self.get_states_list()
 *         inputs_list = self.get_input_list()             # <<<<<<<<<<<<<<
 * 
 *         states = OrderedDict()
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_input_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5032; __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 = 5032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_inputs_list = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5034
 *         inputs_list = self.get_input_list()
 * 
 *         states = OrderedDict()             # <<<<<<<<<<<<<<
 *         inputs = OrderedDict()
 *         for i in range(0,len(derivatives)):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5034; __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 = 5034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_states = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5035
 * 
 *         states = OrderedDict()
 *         inputs = OrderedDict()             # <<<<<<<<<<<<<<
 *         for i in range(0,len(derivatives)):
 *             states[derivatives[i]]  = []
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__OrderedDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5035; __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 = 5035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_inputs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5036
 *         states = OrderedDict()
 *         inputs = OrderedDict()
 *         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 = 5036; __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 = 5036; __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 = 5036; __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 = 5036; __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 = 5036; __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 = 5036; __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 = 5036; __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 = 5036; __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 = 5036; __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 = 5036; __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":5037
 *         inputs = OrderedDict()
 *         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 = 5037; __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 = 5037; __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 = 5037; __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":5038
 *         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 = 5038; __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 = 5038; __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 = 5038; __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":5040
 *             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 = 5040; __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 = 5040; __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 = 5040; __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 = 5040; __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 = 5040; __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 = 5040; __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 = 5040; __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 = 5040; __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 = 5040; __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 = 5040; __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 = 5040; __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 = 5040; __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":5041
 * 
 *             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 = 5041; __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 = 5041; __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 = 5041; __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 = 5041; __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":5042
 *             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 = 5042; __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 = 5042; __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 = 5042; __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 = 5042; __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":5043
 *                 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 = 5043; __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 = 5043; __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 = 5043; __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 = 5043; __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":5045
 *                     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 = 5045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_5) {

          /* "pyfmi\fmi.pyx":5046
 * 
 *                     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 = 5046; __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 = 5046; __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 = 5046; __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_L11;
        }

        /* "pyfmi\fmi.pyx":5047
 *                     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 = 5047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_5) {

          /* "pyfmi\fmi.pyx":5048
 *                         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 = 5048; __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 = 5048; __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 = 5048; __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_L11;
        }
        __pyx_L11:;
        goto __pyx_L10;
      }
      __pyx_L10:;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5051
 * 
 *         #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":5052
 *         #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":5054
 *         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 = 5054; __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_109get_derivatives_dependencies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_108get_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_109get_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_108get_derivatives_dependencies(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5006
 *         return states, inputs
 * 
 *     cpdef get_derivatives_dependencies(self):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieve the list of variables that the derivatives are
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_108get_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_vtab)->get_derivatives_dependencies(__pyx_v_self, 1); 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_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_111_get_directional_proxy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_111_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_288;
    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 = 5056; __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 = 5056; __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 = 5056; __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 = 5056; __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_110_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":5056
 *         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_110_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":5057
 * 
 *     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 = 5057; __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":5058
 *     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 = 5058; __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":5059
 *         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 = 5059; __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":5061
 *         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 = 5061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":5062
 * 
 *         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 = 5062; __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 = 5062; __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 = 5062; __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":5063
 *         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 = 5063; __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 = 5063; __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 = 5063; __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 = 5063; __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 = 5063; __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 = 5063; __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":5064
 *             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 = 5064; __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 = 5064; __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 = 5064; __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 = 5064; __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 = 5064; __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":5065
 *             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 = 5065; __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 = 5065; __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 = 5065; __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 = 5065; __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 = 5065; __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":5067
 *             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 = 5067; __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 = 5067; __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 = 5067; __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 = 5067; __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 = 5067; __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 = 5067; __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":5068
 * 
 *         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 = 5068; __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 = 5068; __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 = 5068; __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 = 5068; __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 = 5068; __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 = 5068; __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 = 5068; __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 = 5068; __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":5069
 *         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 = 5069; __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 = 5069; __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 = 5069; __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 = 5069; __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":5071
 *             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 = 5071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_289); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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":5072
 * 
 *             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 = 5072; __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 = 5072; __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 = 5072; __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 = 5072; __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 = 5072; __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":5073
 *             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 = 5073; __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 = 5073; __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 = 5073; __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 = 5073; __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 = 5073; __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":5075
 *             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 = 5075; __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 = 5075; __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 = 5075; __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 = 5075; __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":5077
 *             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 = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_5 == 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":5078
 * 
 *         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 = 5078; __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 = 5078; __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 = 5078; __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 = 5078; __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 = 5078; __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 = 5078; __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 = 5078; __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 = 5078; __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 = 5078; __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":5080
 *             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 = 5080; __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 = 5080; __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 = 5080; __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 = 5080; __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 = 5080; __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 = 5080; __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 = 5080; __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 = 5080; __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 = 5080; __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 = 5080; __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 = 5080; __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_113_get_A(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_113_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_112_get_A(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5082
 *             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_112_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":5083
 * 
 *     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":5084
 *     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_vtab)->get_derivatives_dependencies(__pyx_v_self, 0); 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);
    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 = 5084; __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 = 5084; __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 = 5084; __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 = 5084; __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 = 5084; __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 = 5084; __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":5085
 *         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 = 5085; __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 = 5085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":5086
 *             [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 = 5086; __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 = 5086; __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 = 5086; __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 = 5086; __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 = 5086; __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 = 5086; __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 = 5086; __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 = 5086; __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 = 5086; __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":5088
 *                 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 = 5088; __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 = 5088; __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 = 5088; __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 = 5088; __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 = 5088; __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 = 5088; __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 = 5088; __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":5089
 *             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":5090
 *                 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 = 5090; __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 = 5090; __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":5091
 *         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 = 5091; __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 = 5091; __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 = 5091; __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 = 5091; __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 = 5091; __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 = 5091; __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 = 5091; __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 = 5091; __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 = 5091; __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 = 5091; __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 = 5091; __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":5092
 *             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":5093
 *             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_287); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5093; __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 = 5093; __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":5094
 *         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 = 5094; __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 = 5094; __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 = 5094; __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 = 5094; __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 = 5094; __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 = 5094; __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 = 5094; __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 = 5094; __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 = 5094; __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 = 5094; __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 = 5094; __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":5096
 *             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_290); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5096; __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 = 5096; __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 = 5096; __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 = 5096; __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 = 5096; __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 = 5096; __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":5098
 *         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":5099
 * 
 *         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":5101
 *             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_115_get_B(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_115_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_114_get_B(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5103
 *         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_114_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":5104
 * 
 *     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":5105
 *     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_vtab)->get_derivatives_dependencies(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5105; __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 = 5105; __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 = 5105; __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 = 5105; __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 = 5105; __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 = 5105; __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 = 5105; __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":5106
 *         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 = 5106; __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 = 5106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":5107
 *             [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 = 5107; __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 = 5107; __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 = 5107; __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 = 5107; __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 = 5107; __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 = 5107; __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 = 5107; __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 = 5107; __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 = 5107; __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":5109
 *                 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 = 5109; __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 = 5109; __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 = 5109; __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 = 5109; __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 = 5109; __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 = 5109; __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 = 5109; __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":5110
 *             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":5111
 *                 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 = 5111; __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 = 5111; __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":5112
 *         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 = 5112; __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 = 5112; __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 = 5112; __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 = 5112; __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 = 5112; __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 = 5112; __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 = 5112; __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 = 5112; __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 = 5112; __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 = 5112; __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 = 5112; __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":5113
 *             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":5114
 *             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_287); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5114; __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 = 5114; __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":5115
 *         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 = 5115; __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 = 5115; __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 = 5115; __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 = 5115; __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 = 5115; __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 = 5115; __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 = 5115; __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 = 5115; __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 = 5115; __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 = 5115; __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 = 5115; __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":5117
 *             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_290); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5117; __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 = 5117; __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 = 5117; __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":5119
 *         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":5120
 * 
 *         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":5122
 *             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_117_get_C(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_117_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_116_get_C(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5124
 *         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_116_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":5125
 * 
 *     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":5126
 *     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_vtab)->get_output_dependencies(__pyx_v_self, 0); 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);
    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 = 5126; __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 = 5126; __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 = 5126; __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 = 5126; __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 = 5126; __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 = 5126; __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":5127
 *         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 = 5127; __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 = 5127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":5128
 *             [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 = 5128; __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 = 5128; __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 = 5128; __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 = 5128; __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 = 5128; __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 = 5128; __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 = 5128; __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 = 5128; __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 = 5128; __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":5130
 *                 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 = 5130; __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 = 5130; __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 = 5130; __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 = 5130; __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 = 5130; __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 = 5130; __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 = 5130; __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":5131
 *             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":5132
 *                 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 = 5132; __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 = 5132; __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":5133
 *         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 = 5133; __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 = 5133; __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 = 5133; __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 = 5133; __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 = 5133; __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 = 5133; __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 = 5133; __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 = 5133; __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 = 5133; __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 = 5133; __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 = 5133; __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":5134
 *             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":5135
 *             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 = 5135; __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 = 5135; __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":5136
 *         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 = 5136; __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 = 5136; __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 = 5136; __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 = 5136; __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 = 5136; __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 = 5136; __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 = 5136; __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 = 5136; __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 = 5136; __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 = 5136; __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 = 5136; __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":5138
 *             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_290); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5138; __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 = 5138; __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 = 5138; __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":5140
 *         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":5141
 * 
 *         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":5143
 *             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_119_get_D(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_119_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_118_get_D(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5145
 *         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_118_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":5146
 * 
 *     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":5147
 *     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_vtab)->get_output_dependencies(__pyx_v_self, 0); 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);
    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 = 5147; __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 = 5147; __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 = 5147; __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 = 5147; __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 = 5147; __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 = 5147; __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":5148
 *         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 = 5148; __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 = 5148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":5149
 *             [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 = 5149; __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 = 5149; __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 = 5149; __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 = 5149; __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 = 5149; __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 = 5149; __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 = 5149; __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 = 5149; __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 = 5149; __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":5151
 *                 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 = 5151; __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 = 5151; __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 = 5151; __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 = 5151; __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 = 5151; __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 = 5151; __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 = 5151; __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":5152
 *             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":5153
 *                 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 = 5153; __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 = 5153; __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":5154
 *         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 = 5154; __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 = 5154; __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 = 5154; __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 = 5154; __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 = 5154; __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 = 5154; __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 = 5154; __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 = 5154; __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 = 5154; __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 = 5154; __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 = 5154; __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":5155
 *             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":5156
 *             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 = 5156; __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 = 5156; __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":5157
 *         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 = 5157; __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 = 5157; __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 = 5157; __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 = 5157; __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 = 5157; __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 = 5157; __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 = 5157; __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 = 5157; __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 = 5157; __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 = 5157; __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 = 5157; __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":5159
 *             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_290); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5159; __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 = 5159; __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 = 5159; __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":5161
 *         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":5162
 * 
 *         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":5164
 *             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_121get_state_space_representation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_120get_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_121get_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_291;
    values[1] = __pyx_k_292;
    values[2] = __pyx_k_293;
    values[3] = __pyx_k_294;
    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 = 5167; __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 = 5167; __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_120get_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":5167
 * 
 * 
 *     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_120get_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":5176
 *         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 = 5176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5177
 *         """
 *         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 = 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;
    __Pyx_DECREF(__pyx_v_A);
    __pyx_v_A = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5178
 *         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 = 5178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5179
 *             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 = 5179; __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 = 5179; __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":5180
 *         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 = 5180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5181
 *             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 = 5181; __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 = 5181; __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":5182
 *         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 = 5182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5183
 *             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 = 5183; __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 = 5183; __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":5185
 *             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 = 5185; __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_123get_states_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_122get_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_123get_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_122get_states_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5188
 * 
 * 
 *     def get_states_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the states.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_122get_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":5198
 *         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 = 5198; __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 = 5198; __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":5200
 *         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":5201
 * 
 *         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":5203
 *         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":5204
 * 
 *         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 = 5204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __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 = 5204; __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 = 5204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5206
 *             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":5207
 * 
 *         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":5208
 *         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":5210
 *             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_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 = 5210; __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":5211
 * 
 *             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 = 5211; __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 = 5211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":5217
 * 
 *         #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":5219
 *         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_125get_input_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_124get_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_125get_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_124get_input_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5221
 *         return variable_dict
 * 
 *     def get_input_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with input variables
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_124get_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":5229
 *             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 = 5229; __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 = 5229; __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 = 5229; __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 = 5229; __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 = 5229; __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 = 5229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":5230
 *         """
 *         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 = 5230; __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 = 5229; __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 = 5230; __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 = 5229; __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 = 5229; __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":5232
 *                              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_127get_output_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_126get_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_127get_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_126get_output_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5234
 *         return variable_dict
 * 
 *     def get_output_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with output variables
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_126get_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":5248
 *         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 = 5248; __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 = 5248; __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":5250
 *         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":5251
 * 
 *         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":5253
 *         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":5254
 * 
 *         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 = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_298), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5254; __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 = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5256
 *             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":5257
 * 
 *         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":5259
 *             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_vtab)->_add_scalar_variable(__pyx_v_self, __pyx_v_variable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5259; __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":5260
 * 
 *             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 = 5260; __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 = 5260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":5263
 * 
 *         #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":5265
 *         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_129get_directional_derivative(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_128get_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_129get_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 = 5267; __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 = 5267; __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 = 5267; __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 = 5267; __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_128get_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":5267
 *         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_128get_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;
  size_t __pyx_v_nv;
  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_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":5319
 * 
 *         #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 = 5319; __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 = 5319; __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 = 5319; __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 = 5319; __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 = 5319; __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 = 5319; __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 = 5319; __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 = 5319; __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 = 5319; __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 = 5319; __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 = 5319; __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 = 5319; __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":5320
 *         #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 = 5320; __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 = 5320; __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 = 5320; __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 = 5320; __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 = 5320; __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 = 5320; __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 = 5320; __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 = 5320; __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 = 5320; __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 = 5320; __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 = 5320; __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 = 5320; __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":5321
 *         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 = 5321; __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 = 5321; __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 = 5321; __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 = 5321; __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 = 5321; __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 = 5321; __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 = 5321; __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 = 5321; __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 = 5321; __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 = 5321; __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 = 5321; __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 = 5321; __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":5323
 *         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 = 5323; __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 = 5323; __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 = 5323; __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 = 5323; __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 = 5323; __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 = 5323; __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 = 5323; __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 = 5323; __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 = 5323; __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 = 5323; __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 = 5323; __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 = 5323; __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":5325
 *         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_299); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5325; __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 = 5325; __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 = 5325; __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":5326
 * 
 *         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 = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_301), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5326; __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 = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5328
 *             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 = 5328; __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 = 5328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (__pyx_t_3 != __pyx_t_13);
  if (__pyx_t_12) {

    /* "pyfmi\fmi.pyx":5329
 * 
 *         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 = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_303), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __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 = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5331
 *             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 = 5331; __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 = 5331; __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 = 5331; __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 = 5331; __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 = 5331; __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 = 5331; __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 = 5331; __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 = 5331; __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 = 5331; __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 = 5331; __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":5332
 * 
 *         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 = 5332; __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 = 5332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":5333
 *         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 = 5333; __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 = 5333; __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":5334
 *             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 = 5334; __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 = 5334; __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 = 5334; __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 = 5334; __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 = 5334; __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 = 5334; __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 = 5334; __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 = 5334; __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 = 5334; __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 = 5334; __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":5335
 *             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 = 5335; __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 = 5335; __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":5337
 *             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 = 5337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nv = __pyx_t_13;

  /* "pyfmi\fmi.pyx":5338
 * 
 *         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 = 5338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nz = __pyx_t_13;

  /* "pyfmi\fmi.pyx":5340
 *         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)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_get_directional_derivative(__pyx_v_self->_fmu, ((fmi2_value_reference_t *)__pyx_v_v_ref->data), __pyx_v_nv, ((fmi2_value_reference_t *)__pyx_v_z_ref->data), __pyx_v_nz, ((fmi2_real_t *)__pyx_v_dv->data), ((fmi2_real_t *)__pyx_v_dz->data));

  /* "pyfmi\fmi.pyx":5342
 *         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)
 * 
 *         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":5343
 * 
 *         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 = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_305), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __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 = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":5345
 *             raise FMUException('An error occured while getting the directional derivative, see the log for possible more information')
 * 
 *         return dz             # <<<<<<<<<<<<<<
 * 
 *     def get_version(self):
 */
  __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;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_131get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_130get_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_131get_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_130get_version(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5347
 *         return dz
 * 
 *     def get_version(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the FMI version of the Model which it was generated according.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_130get_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":5360
 *             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":5361
 *         """
 *         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 = 5361; __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_133get_model_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_132get_model_version[] = "\n        Returns the version fo the FMU.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_133get_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_132get_model_version(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5363
 *         return version
 * 
 *     def get_model_version(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version fo the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_132get_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":5368
 *         """
 *         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":5369
 *         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 = 5369; __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_7));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
  }
  __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_135get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_134get_name[] = "\n        Return the model name as used in the modeling environment.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_135get_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_134get_name(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5371
 *         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_134get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_name", 0);

  /* "pyfmi\fmi.pyx":5375
 *         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_137get_author(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_136get_author[] = "\n        Return the name and organization of the model author.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_137get_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_136get_author(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5377
 *         return self._modelName
 * 
 *     def get_author(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the name and organization of the model author.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_136get_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":5382
 *         """
 *         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":5383
 *         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 = 5383; __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_7));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
  }
  __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_139get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_138get_description[] = "\n        Return the model description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_139get_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_138get_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5385
 *         return author if author != NULL else ""
 * 
 *     def get_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model description.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_138get_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":5390
 *         """
 *         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":5391
 *         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 = 5391; __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_7));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
  }
  __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_141get_copyright(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_140get_copyright[] = "\n        Return the model copyright.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_141get_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_140get_copyright(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5393
 *         return desc if desc != NULL else ""
 * 
 *     def get_copyright(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model copyright.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_140get_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":5398
 *         """
 *         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":5399
 *         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 = 5399; __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_7));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
  }
  __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_143get_license(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_142get_license[] = "\n        Return the model license.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_143get_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_142get_license(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5401
 *         return copyright if copyright != NULL else ""
 * 
 *     def get_license(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model license.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_142get_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":5406
 *         """
 *         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":5407
 *         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 = 5407; __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_7));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
  }
  __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_145get_generation_tool(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_144get_generation_tool[] = "\n        Return the model generation tool.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_145get_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_144get_generation_tool(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5409
 *         return license if license != NULL else ""
 * 
 *     def get_generation_tool(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model generation tool.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_144get_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":5414
 *         """
 *         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":5415
 *         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 = 5415; __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_7));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
  }
  __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_147get_generation_date_and_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_146get_generation_date_and_time[] = "\n        Return the model generation date and time.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_147get_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_146get_generation_date_and_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5417
 *         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_146get_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":5422
 *         """
 *         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":5423
 *         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 = 5423; __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_7));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_7);
  }
  __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_149get_guid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_148get_guid[] = "\n        Return the model GUID.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_149get_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_148get_guid(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5425
 *         return gen if gen != NULL else ""
 * 
 *     def get_guid(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model GUID.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_148get_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":5429
 *         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 = 5429; __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 = 5429; __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 = 5429; __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 = 5429; __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":5430
 *         """
 *         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_151get_variable_naming_convention(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_150get_variable_naming_convention[] = "\n        Return the variable naming convention.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_151get_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_150get_variable_naming_convention(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5432
 *         return guid
 * 
 *     def get_variable_naming_convention(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the variable naming convention.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_150get_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":5437
 *         """
 *         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":5438
 *         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":5439
 *         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":5440
 *         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":5441
 *             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":5443
 *             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_153get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_152get_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_153get_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_152get_identifier(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5445
 *             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_152get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_identifier", 0);

  /* "pyfmi\fmi.pyx":5450
 *         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_155get_model_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_154get_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_155get_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_154get_model_types_platform(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5452
 *         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_154get_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":5457
 *         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 = 5457; __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":152
 *     cdef list           _log
 *     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":157
 *     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 = 157; __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":158
 *     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 = 158; __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":159
 *     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 = 159; __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":161
 *     cdef public list    _save_bool_variables_val
 *     cdef object         __t
 *     cdef public object  _pyEventInfo             # <<<<<<<<<<<<<<
 *     cdef char* _fmu_log_name
 *     cdef char* _fmu_temp_dir
 */

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":171
 *     cdef object         _derivatives_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_15);
    values[2] = __pyx_k_306;
    values[3] = ((PyObject *)__pyx_kp_s_7);
    values[4] = __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  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 = 5464; __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 = 5464; __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":5464
 *     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":5491
 * 
 *         #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 = 5491; __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 = 5491; __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 = 5491; __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":5493
 *         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":5494
 * 
 *         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":5495
 *         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 = 5495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_309), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5495; __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 = 5495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5497
 *                 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_310); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5497; __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 = 5497; __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 = 5497; __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 = 5497; __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 = 5497; __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 = 5497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5498
 * 
 *         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 = 5498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_312), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5498; __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 = 5498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5500
 *             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 = 5500; __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 = 5500; __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 = 5500; __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 = 5500; __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":5501
 * 
 *         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 = 5501; __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 = 5501; __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":5503
 *         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":5507
 *         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":5508
 *         """
 *         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":5509
 *         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":5511
 *             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":5512
 * 
 *         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":5514
 *             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":5515
 * 
 *         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":5517
 *             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":5518
 * 
 *         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.callbacks), __pyx_v_self->__pyx_base._fmu_temp_dir);

    /* "pyfmi\fmi.pyx":5519
 *         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":5520
 *             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":5522
 *             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":5523
 * 
 *         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":5525
 *             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._fmu_log_name != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5526
 * 
 *         if self._fmu_log_name != NULL:
 *             FMIL.free(self._fmu_log_name)             # <<<<<<<<<<<<<<
 *             self._fmu_log_name = NULL
 * 
 */
    free(__pyx_v_self->__pyx_base._fmu_log_name);

    /* "pyfmi\fmi.pyx":5527
 *         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._fmu_log_name = NULL;
    goto __pyx_L8;
  }
  __pyx_L8:;

  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":5529
 *             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 = 5529; __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 = 5529; __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":5536
 *             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":5529
 *             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_vtab)->_get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5529; __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":5538
 *         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 = 5538; __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 = 5538; __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 = 5538; __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 = 5538; __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":5546
 *                 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 = 5546; __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 = 5538; __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":5538
 *         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_vtab)->_set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5538; __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;
}

/* 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_313;
    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 = 5554; __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 = 5554; __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 = 5554; __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 = 5554; __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 = 5554; __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":5554
 *     """)
 * 
 *     def 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) {
  int __pyx_v_status;
  fmi2_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":5583
 *         cdef FMIL.fmi2_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 = 5583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5584
 * 
 *         if new_step:
 *             new_s = 1             # <<<<<<<<<<<<<<
 *         else:
 *             new_s = 0
 */
    __pyx_v_new_s = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5586
 *             new_s = 1
 *         else:
 *             new_s = 0             # <<<<<<<<<<<<<<
 * 
 *         self.time = current_t + step_size
 */
    __pyx_v_new_s = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5588
 *             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_2 = PyFloat_FromDouble((__pyx_v_current_t + __pyx_v_step_size)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5588; __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 = 5588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5590
 *         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":5592
 *         status = FMIL.fmi2_import_do_step(self._fmu, current_t, step_size, new_s)
 * 
 *         return status             # <<<<<<<<<<<<<<
 * 
 *     def cancel_step(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5592; __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.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":5594
 *         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":5608
 *         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":5609
 * 
 *         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":5610
 *         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 = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_315), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5610; __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 = 5610; __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 = 5613; __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 = 5613; __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 = 5613; __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 = 5613; __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 = 5613; __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":5613
 * 
 * 
 *     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;
  Py_ssize_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;
  PyObject *(*__pyx_t_17)(PyObject *);
  int __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  size_t __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":5634
 *         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).flatten()             # <<<<<<<<<<<<<<
 * 
 *         nref = len(val)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5634; __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 = 5634; __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 = 5634; __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 = 5634; __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 = 5634; __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 = 5634; __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 = 5634; __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 = 5634; __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 = 5634; __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 = 5634; __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 = 5634; __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 = 5634; __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 = 5634; __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":5636
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c']            val = N.array(values, dtype=N.float, ndmin=1).flatten()
 * 
 *         nref = len(val)             # <<<<<<<<<<<<<<
 *         orders = N.array([0]*nref, dtype=N.int32)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_val)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":5637
 * 
 *         nref = len(val)
 *         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 = 5637; __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 = 5637; __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 = 5637; __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 = 5637; __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 = 5637; __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 = 5637; __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 = 5637; __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 = 5637; __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 = 5637; __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 = 5637; __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 = 5637; __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":5639
 *         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":5642
 *         #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":5643
 * 
 *         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 = 5643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_316), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5643; __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 = 5643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5644
 *         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":5645
 *             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 = 5645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_317), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5645; __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 = 5645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5647
 *             raise FMUException("The FMU does not support input derivatives.")
 * 
 *         if isinstance(variables,str):             # <<<<<<<<<<<<<<
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).flatten()
 *             value_refs[0] = self.get_variable_valueref(variables)
 */
  __pyx_t_13 = PyString_Check(__pyx_v_variables); 
  if (__pyx_t_13) {

    /* "pyfmi\fmi.pyx":5648
 * 
 *         if isinstance(variables,str):
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *             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 = 5648; __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 = 5648; __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 = 5648; __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 = 5648; __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 = 5648; __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 = 5648; __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 = 5648; __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 = 5648; __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 = 5648; __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 = 5648; __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__flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5648; __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 = 5648; __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 = 5648; __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 = 5648; __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":5649
 *         if isinstance(variables,str):
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).flatten()
 *             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).flatten()
 */
    __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__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 = 5649; __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 = 5649; __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":5650
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).flatten()
 *             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).flatten()
 *             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 = 5650; __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 = 5650; __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 = 5650; __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_7 = 0;
      __pyx_t_17 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_17 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_5 = __pyx_t_17(__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 = 5650; __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 = 5650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_18 = PyString_Check(__pyx_v_v); 
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_18); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5650; __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_19)); __pyx_t_19 = 0;
      if (unlikely(__Pyx_PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5650; __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 = 5650; __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 = 5650; __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_18 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_20 = __pyx_t_18;
  } else {
    __pyx_t_20 = __pyx_t_13;
  }
  if (__pyx_t_20) {

    /* "pyfmi\fmi.pyx":5651
 *             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).flatten()             # <<<<<<<<<<<<<<
 *             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 = 5651; __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 = 5651; __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 = 5651; __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 = 5651; __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 = 5651; __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 = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_19 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__uint32); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_19 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __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_19, __pyx_n_s__flatten); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __pyx_t_19 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_19);
    {
      __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 = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_19);
    __pyx_t_19 = 0;

    /* "pyfmi\fmi.pyx":5652
 *         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).flatten()
 *             for i in range(nref):             # <<<<<<<<<<<<<<
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 *                 orders[i] = order
 */
    __pyx_t_21 = __pyx_v_nref;
    for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
      __pyx_v_i = __pyx_t_22;

      /* "pyfmi\fmi.pyx":5653
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).flatten()
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])             # <<<<<<<<<<<<<<
 *                 orders[i] = order
 *         else:
 */
      __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_variables, __pyx_v_i, sizeof(size_t)+1, __Pyx_PyInt_to_py_size_t); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_t_19, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 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 = 5653; __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":5654
 *             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 = 5654; __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":5656
 *                 orders[i] = order
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_set_real_input_derivatives(self._fmu, <FMIL.fmi2_value_reference_t*> value_refs.data, nref,
 */
    __pyx_t_19 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __pyx_t_2 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_k_tuple_318), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 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 = 5656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5659
 * 
 *         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)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __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_v_nref, ((fmi2_integer_t *)__pyx_v_orders->data), ((fmi2_real_t *)__pyx_v_val->data));

  /* "pyfmi\fmi.pyx":5661
 *                                                                 <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_20 = (__pyx_v_status != 0);
  if (__pyx_t_20) {

    /* "pyfmi\fmi.pyx":5662
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     def get_output_derivatives(self, variables, FMIL.fmi2_integer_t order):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_19 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_319), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 5662; __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_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_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;
}

/* 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 = 5664; __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 = 5664; __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 = 5664; __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 = 5664; __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":5664
 *             raise FMUException('Failed to set the Real input derivatives.')
 * 
 *     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":5690
 * 
 * 
 *         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":5692
 *         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":5693
 * 
 *         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 = 5693; __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 = 5693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_100), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5693; __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 = 5693; __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 = 5693; __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 = 5693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5695
 *             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).flatten()
 */
  __pyx_t_3 = PyString_Check(__pyx_v_variables); 
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":5696
 * 
 *         if isinstance(variables,str):
 *             nref = 1             # <<<<<<<<<<<<<<
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).flatten()
 *             orders = N.array([order], dtype=N.int32)
 */
    __pyx_v_nref = 1;

    /* "pyfmi\fmi.pyx":5697
 *         if isinstance(variables,str):
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *             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 = 5697; __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 = 5697; __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 = 5697; __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 = 5697; __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 = 5697; __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 = 5697; __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 = 5697; __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 = 5697; __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 = 5697; __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 = 5697; __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__flatten); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5697; __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 = 5697; __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 = 5697; __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 = 5697; __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":5698
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).flatten()
 *             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 = 5698; __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 = 5698; __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 = 5698; __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 = 5698; __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 = 5698; __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 = 5698; __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 = 5698; __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 = 5698; __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 = 5698; __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 = 5698; __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 = 5698; __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 = 5698; __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":5699
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).flatten()
 *             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_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 = 5699; __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 = 5699; __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":5700
 *             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).flatten()
 */
  __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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 = 5700; __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":5701
 *             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).flatten()
 *             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 = 5701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_nref = __pyx_t_17;

    /* "pyfmi\fmi.pyx":5702
 *         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).flatten()             # <<<<<<<<<<<<<<
 *             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 = 5702; __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 = 5702; __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 = 5702; __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 = 5702; __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 = 5702; __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 = 5702; __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 = 5702; __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 = 5702; __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 = 5702; __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 = 5702; __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__flatten); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5702; __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 = 5702; __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 = 5702; __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 = 5702; __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":5703
 *             nref = len(variables)
 *             value_refs = N.array([0]*nref, dtype=N.uint32, ndmin=1).flatten()
 *             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 = 5703; __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 = 5703; __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 = 5703; __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 = 5703; __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 = 5703; __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 = 5703; __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 = 5703; __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 = 5703; __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 = 5703; __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 = 5703; __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 = 5703; __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":5704
 *             value_refs = N.array([0]*nref, dtype=N.uint32, ndmin=1).flatten()
 *             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":5705
 *             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 = 5705; __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_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 = 5705; __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 = 5705; __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":5706
 *             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 = 5706; __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":5708
 *                 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 = 5708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_19 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_320), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5708; __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 = 5708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5710
 *             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 = 5710; __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 = 5710; __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 = 5710; __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 = 5710; __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 = 5710; __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 = 5710; __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 = 5710; __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 = 5710; __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 = 5710; __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 = 5710; __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 = 5710; __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 = 5710; __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 = 5710; __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":5713
 * 
 *         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)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __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_v_nref, ((fmi2_integer_t *)__pyx_v_orders->data), ((fmi2_real_t *)__pyx_v_values->data));

  /* "pyfmi\fmi.pyx":5715
 *                                                             <FMIL.fmi2_integer_t*> orders.data, <FMIL.fmi2_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":5716
 * 
 *         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 = 5716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_321), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5716; __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 = 5716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":5718
 *             raise FMUException('Failed to get the Real output derivatives.')
 * 
 *         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_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;
}

/* 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":5721
 * 
 * 
 *     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":5748
 *         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 = 5748; __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 = 5748; __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 = 5748; __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 = 5748; __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":5749
 * 
 *         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 = 5749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5751
 *             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 = 5751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_323), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5751; __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 = 5751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5753
 *             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":5754
 * 
 *         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":5755
 *         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 = 5755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_325), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5755; __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 = 5755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5757
 *             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 = 5757; __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":5759
 *         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":5780
 *         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 = 5780; __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 = 5780; __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 = 5780; __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 = 5780; __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":5781
 * 
 *         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 = 5781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5783
 *             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 = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_326), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5783; __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 = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5786
 * 
 * 
 *         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":5787
 * 
 *         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":5788
 *         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 = 5788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_327), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5788; __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 = 5788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5790
 *             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 = 5790; __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":5792
 *         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":5813
 *         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 = 5813; __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 = 5813; __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 = 5813; __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 = 5813; __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":5814
 * 
 *         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 = 5814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5816
 *             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 = 5816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_328), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5816; __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 = 5816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5819
 * 
 * 
 *         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":5820
 * 
 *         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":5821
 *         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 = 5821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_329), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5821; __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 = 5821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5823
 *             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 = 5823; __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":5825
 *         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":5846
 *         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 = 5846; __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 = 5846; __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 = 5846; __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 = 5846; __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":5847
 * 
 *         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 = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5849
 *             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 = 5849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_330), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5849; __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 = 5849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5852
 * 
 * 
 *         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":5853
 * 
 *         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":5854
 *         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 = 5854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_331), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5854; __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 = 5854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5856
 *             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 = 5856; __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":5858
 *         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":5879
 *         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 = 5879; __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 = 5879; __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 = 5879; __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 = 5879; __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":5880
 * 
 *         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 = 5880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5882
 *             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 = 5882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_332), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5882; __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 = 5882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5885
 * 
 * 
 *         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":5886
 * 
 *         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":5887
 *         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 = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_333), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5887; __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 = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5889
 *             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 = 5889; __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":5895
 *                  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_334;
    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 = 5892; __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 = 5892; __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":5892
 * 
 * 
 *     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":5955
 *             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 = 5955; __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 = 5955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":5956
 *         """
 *         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_119); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5956; __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 = 5956; __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":5957
 *         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 = 5957; __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 = 5957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":5958
 *             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_120); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5958; __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 = 5958; __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":5960
 *             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_121); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyfmi\fmi.pyx":5965
 *                                              '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 = 5960; __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_95));
  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __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 = 5960; __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 = 5967; __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 = 5967; __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":5967
 *                                              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":5984
 *             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 = 5984; __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 = 5984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_95));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __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 = 5984; __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":5986
 *         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":6002
 *             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 = 6002; __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":6003
 *         """
 *         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 = 6003; __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 = 6003; __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 = 6003; __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 = 6003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6004
 *         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 = 6004; __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 = 6004; __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 = 6004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_135), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6005
 *         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 = 6005; __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 = 6005; __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 = 6005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_136), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6006
 *         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 = 6006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_137), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6007
 *         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 = 6007; __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 = 6007; __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 = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_138), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6008
 *         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 = 6008; __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 = 6008; __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 = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_139), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6009
 *         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 = 6009; __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 = 6009; __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 = 6009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_140), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6010
 *         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 = 6010; __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 = 6010; __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 = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_335), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6011
 *         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 = 6011; __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 = 6011; __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 = 6011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_336), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6012
 *         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 = 6012; __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 = 6012; __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 = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_337), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6014
 *         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":6016
 *         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":6020
 *         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 = 6020; __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":6022
 *         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":6026
 *         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 = 6026; __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_15);
    values[2] = __pyx_k_338;
    values[3] = ((PyObject *)__pyx_kp_s_7);
    values[4] = __pyx_k_339;
    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 = 6034; __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 = 6034; __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":6034
 *     """
 * 
 *     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":6060
 *         """
 *         #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 = 6060; __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 = 6060; __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 = 6060; __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":6062
 *         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":6063
 * 
 *         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":6064
 *         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 = 6064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_341), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6064; __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 = 6064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6066
 *                 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_310); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6066; __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 = 6066; __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 = 6066; __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 = 6066; __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 = 6066; __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 = 6066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":6067
 * 
 *         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 = 6067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_342), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6067; __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 = 6067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":6069
 *             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 = 6069; __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 = 6069; __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":6070
 * 
 *         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 = 6070; __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 = 6070; __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":6071
 *         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 = 6071; __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 = 6071; __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":6072
 *         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 = 6072; __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 = 6072; __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":6073
 *         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 = 6073; __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 = 6073; __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":6074
 *         self._eventInfo.valuesOfContinuousStatesChanged   = FMI2_TRUE
 *         self._eventInfo.nextEventTimeDefined              = FMI2_FALSE
 *         self._eventInfo.nextEventTime                     = 0.0             # <<<<<<<<<<<<<<
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_ME(self._fmu))
 */
  __pyx_v_self->__pyx_base._eventInfo.nextEventTime = 0.0;

  /* "pyfmi\fmi.pyx":6076
 *         self._eventInfo.nextEventTime                     = 0.0
 * 
 *         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 = 6076; __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 = 6076; __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 = 6076; __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 = 6076; __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":6077
 * 
 *         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 = 6077; __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 = 6077; __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":6079
 *         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":6084
 *         """
 * 
 *         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":6085
 * 
 *         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":6086
 *         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":6088
 *             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":6089
 * 
 *         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":6091
 *             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":6092
 * 
 *         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":6094
 *             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":6095
 * 
 *         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.callbacks), __pyx_v_self->__pyx_base._fmu_temp_dir);

    /* "pyfmi\fmi.pyx":6096
 *         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":6097
 *             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":6099
 *             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":6100
 * 
 *         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":6102
 *             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._fmu_log_name != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":6103
 * 
 *         if self._fmu_log_name != NULL:
 *             FMIL.free(self._fmu_log_name)             # <<<<<<<<<<<<<<
 *             self._fmu_log_name = NULL
 * 
 */
    free(__pyx_v_self->__pyx_base._fmu_log_name);

    /* "pyfmi\fmi.pyx":6104
 *         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._fmu_log_name = NULL;
    goto __pyx_L8;
  }
  __pyx_L8:;

  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":6106
 *             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 = 6106; __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 = 6106; __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":6113
 *             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":6106
 *             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_vtab)->_get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6106; __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":6115
 *         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 = 6115; __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 = 6115; __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 = 6115; __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 = 6115; __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":6125
 * 
 *         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":6127
 *         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":6128
 * 
 *         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 = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_343), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6128; __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 = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6129
 *         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 = 6129; __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 = 6115; __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":6115
 *         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_vtab)->_set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6115; __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":6137
 *     """)
 * 
 *     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":6168
 *             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 = 6168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_344, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6169
 *         """
 *         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 = 6169; __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 = 6169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6170
 *         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 = 6170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_345, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6171
 *         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 = 6171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_346, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6172
 *         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 = 6172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_347, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6173
 *         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 = 6173; __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 = 6173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6175
 *         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":6177
 *         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":6183
 *         """
 *         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":6185
 *         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":6186
 * 
 *         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 = 6186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_349), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6186; __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 = 6186; __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":6188
 *             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":6194
 *         """
 *         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":6196
 *         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":6197
 * 
 *         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 = 6197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_351), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6197; __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 = 6197; __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":6199
 *             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":6215
 *         """
 *         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 = 6215; __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 = 6215; __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 = 6215; __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 = 6215; __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 = 6215; __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 = 6215; __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 = 6215; __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 = 6215; __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 = 6215; __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 = 6215; __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 = 6215; __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":6217
 *         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":6219
 *         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":6220
 * 
 *         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 = 6220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_352), NULL); 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_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 = 6220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6222
 *             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_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  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 = 6224; __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 = 6224; __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":6224
 *         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":6246
 *         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 = 6246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":6247
 * 
 *         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":6248
 *         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":6249
 *             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 = 6249; __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 = 6249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_162), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6249; __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 = 6249; __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 = 6249; __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 = 6249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6251
 *                 raise FMUException('Failed to update the events at time: %E.'%self.time)
 *         else:
 *             tmpValuesOfContinuousStatesChanged = False             # <<<<<<<<<<<<<<
 *             tmpNominalsOfContinuousStatesChanged = False
 * 
 */
    __pyx_v_tmpValuesOfContinuousStatesChanged = 0;

    /* "pyfmi\fmi.pyx":6252
 *         else:
 *             tmpValuesOfContinuousStatesChanged = False
 *             tmpNominalsOfContinuousStatesChanged = False             # <<<<<<<<<<<<<<
 * 
 *             self._eventInfo.newDiscreteStatesNeeded = FMI2_TRUE
 */
    __pyx_v_tmpNominalsOfContinuousStatesChanged = 0;

    /* "pyfmi\fmi.pyx":6254
 *             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 = 6254; __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 = 6254; __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":6255
 * 
 *             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":6256
 *             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":6258
 *                 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":6259
 * 
 *                 if self._eventInfo.nominalsOfContinuousStatesChanged:
 *                     tmpNominalsOfContinuousStatesChanged = True             # <<<<<<<<<<<<<<
 *                 if self._eventInfo.valuesOfContinuousStatesChanged:
 *                     tmpValuesOfContinuousStatesChanged = True
 */
        __pyx_v_tmpNominalsOfContinuousStatesChanged = 1;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "pyfmi\fmi.pyx":6260
 *                 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":6261
 *                     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":6262
 *                 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":6263
 *                     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 = 6263; __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 = 6263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_162), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6263; __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 = 6263; __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 = 6263; __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 = 6263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L9;
      }
      __pyx_L9:;
    }

    /* "pyfmi\fmi.pyx":6266
 * 
 *             # 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":6267
 *             # 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":6268
 *             if tmpNominalsOfContinuousStatesChanged:
 *                 self._eventInfo.nominalsOfContinuousStatesChanged = True
 *             if tmpValuesOfContinuousStatesChanged:             # <<<<<<<<<<<<<<
 *                 self._eventInfo.valuesOfContinuousStatesChanged = True
 * 
 */
    if (__pyx_v_tmpValuesOfContinuousStatesChanged) {

      /* "pyfmi\fmi.pyx":6269
 *                 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":6271
 *                 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":6292
 *         """
 * 
 *         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_159); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6292; __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 = 6292; __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":6293
 * 
 *         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 = 6293; __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 = 6293; __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_160); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6293; __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 = 6293; __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":6295
 *         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 = 6295; __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_354,0};
    PyObject* values[1] = {0};
    values[0] = __pyx_k_355;
    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_354);
          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 = 6297; __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 = 6297; __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":6297
 *         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":6311
 *         """
 *         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 = 6311; __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 = 6311; __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 = 6311; __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 = 6311; __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":6315
 *         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":6317
 *         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":6318
 * 
 *         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 = 6318; __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 = 6318; __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 = 6318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6320
 *             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 = 6320; __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 = 6320; __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 = 6320; __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 = 6320; __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 = 6320; __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 = 6320; __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 = 6320; __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":6322
 *         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":6331
 *         """
 *         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 = 6331; __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 = 6331; __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 = 6331; __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 = 6331; __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 = 6331; __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 = 6331; __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 = 6331; __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 = 6331; __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 = 6331; __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 = 6331; __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 = 6331; __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":6332
 *         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":6334
 *         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":6335
 * 
 *         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 = 6335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_357), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6335; __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 = 6335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6337
 *             raise FMUException('Failed to retrieve the continuous states.')
 * 
 *         return ndx             # <<<<<<<<<<<<<<
 * 
 *     def _set_continuous_states(self, N.ndarray[FMIL.fmi2_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.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 = 6339; __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":6339
 *         return ndx
 * 
 *     def _set_continuous_states(self, N.ndarray[FMIL.fmi2_real_t] 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_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6339; __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":6349
 *         """
 *         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 = 6349; __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":6351
 *         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 = 6351; __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 = 6351; __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 = 6351; __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 = 6351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":6352
 * 
 *         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 = 6352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_358), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __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 = 6352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6357
 *                 '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":6359
 *         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":6360
 * 
 *         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 = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_359), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6360; __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 = 6360; __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":6369
 *     """)
 * 
 *     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":6377
 *         """
 *         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 = 6377; __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 = 6377; __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 = 6377; __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 = 6377; __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 = 6377; __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 = 6377; __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 = 6377; __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 = 6377; __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 = 6377; __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 = 6377; __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 = 6377; __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":6380
 * 
 *         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":6382
 *                 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":6383
 * 
 *         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 = 6383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_360), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6383; __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 = 6383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6385
 *             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":6393
 *     """)
 * 
 *     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 = 6393; __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 = 6393; __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":6409
 *         """
 *         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 = 6409; __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 = 6409; __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 = 6409; __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 = 6409; __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 = 6409; __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 = 6409; __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 = 6409; __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 = 6409; __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 = 6409; __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 = 6409; __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 = 6409; __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":6411
 *         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":6413
 *         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":6414
 * 
 *         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 = 6414; __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 = 6414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_156), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6414; __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 = 6414; __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 = 6414; __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 = 6414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6416
 *             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":6393
 *     """)
 * 
 *     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_vtab)->get_derivatives(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6393; __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":6422
 *                  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_361;
    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 = 6419; __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 = 6419; __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":6419
 * 
 * 
 *     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":6486
 *             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 = 6486; __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 = 6486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":6487
 *         """
 *         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_119); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6487; __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 = 6487; __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":6488
 *         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 = 6488; __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 = 6488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":6489
 *             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_120); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6489; __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 = 6489; __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":6491
 *             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_121); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyfmi\fmi.pyx":6496
 *                                              '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 = 6491; __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_95));
  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __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 = 6491; __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 = 6498; __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 = 6498; __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":6498
 *                                              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":6515
 *             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 = 6515; __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 = 6515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_95));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __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 = 6515; __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":6517
 *         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":6532
 *             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 = 6532; __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":6533
 *         """
 *         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 = 6533; __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 = 6533; __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 = 6533; __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 = 6533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6534
 *         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 = 6534; __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 = 6534; __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 = 6534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_362), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6535
 *         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 = 6535; __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 = 6535; __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 = 6535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_139), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6536
 *         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 = 6536; __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 = 6536; __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 = 6536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_140), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6537
 *         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 = 6537; __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 = 6537; __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 = 6537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_335), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6538
 *         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 = 6538; __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 = 6538; __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 = 6538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_336), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6539
 *         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 = 6539; __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 = 6539; __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 = 6539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_337), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6540
 *         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 = 6540; __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 = 6540; __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 = 6540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_363), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6542
 *         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":6544
 *         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":6548
 *         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 = 6548; __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":6550
 *         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":6554
 *         Check support for getting and setting the FMU state.
 *         """
 *         return FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate)             # <<<<<<<<<<<<<<
 * 
 * #Temporary should be removed! (after a period)
 */
  __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 = 6554; __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 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_15);
    values[2] = __pyx_k_364;
    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 = 6558; __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 = 6558; __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":6558
 * #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":6559
 * 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_365)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":6560
 *     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 = 6560; __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 = 6560; __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 = 6560; __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_15);
    values[2] = __pyx_k_366;
    values[3] = ((PyObject *)__pyx_kp_s_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  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 = 6562; __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 = 6562; __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":6562
 *         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":6578
 * 
 *     #Used for deallocation
 *     allocated_context = False             # <<<<<<<<<<<<<<
 *     allocated_xml = False
 *     fmu_temp_dir = None
 */
  __pyx_v_allocated_context = 0;

  /* "pyfmi\fmi.pyx":6579
 *     #Used for deallocation
 *     allocated_context = False
 *     allocated_xml = False             # <<<<<<<<<<<<<<
 *     fmu_temp_dir = None
 * 
 */
  __pyx_v_allocated_xml = 0;

  /* "pyfmi\fmi.pyx":6580
 *     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":6582
 *     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 = 6582; __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 = 6582; __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 = 6582; __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 = 6582; __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 = 6582; __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 = 6582; __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 = 6582; __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 = 6582; __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 = 6582; __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 = 6582; __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":6583
 * 
 *     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 = 6583; __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 = 6583; __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":6586
 * 
 *     # 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 = 6586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_367), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6586; __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 = 6586; __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":6587
 *     # 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 = 6587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_368), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6587; __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 = 6587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6590
 * 
 *     #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":6591
 *     #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":6592
 *     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":6593
 *     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":6594
 *     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":6595
 *     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 = 6595; __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":6599
 * 
 *     #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":6600
 *     #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":6601
 *     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":6603
 *     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":6604
 * 
 *     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":6607
 * 
 *     #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 = 6607; __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 = 6607; __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 = 6607; __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":6609
 *     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 = 6609; __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 = 6609; __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 = 6609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6610
 * 
 *     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":6613
 * 
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    if (__pyx_v_allocated_context) {

      /* "pyfmi\fmi.pyx":6614
 *         #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":6616
 *             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 = 6616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6617
 * 
 *         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 = 6617; __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 = 6617; __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 = 6617; __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 = 6617; __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 = 6617; __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_24), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6617; __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 = 6617; __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 = 6617; __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 = 6617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6619
 *             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 = 6619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_369), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6619; __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 = 6619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L6:;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":6620
 *         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 = 6620; __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 = 6620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6622
 *     if version != 1:
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    if (__pyx_v_allocated_context) {

      /* "pyfmi\fmi.pyx":6623
 *         #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":6625
 *             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 = 6625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_371), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6625; __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 = 6625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":6628
 * 
 *     #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 = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__fmu = fmi1_import_parse_xml(__pyx_v_context, __pyx_t_9);

  /* "pyfmi\fmi.pyx":6629
 *     #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":6630
 *     _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":6631
 *     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 = 6631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6632
 *         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 = 6632; __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 = 6632; __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 = 6632; __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 = 6632; __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 = 6632; __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_29), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6632; __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 = 6632; __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 = 6632; __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 = 6632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L10;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6634
 *             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 = 6634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_372), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6634; __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 = 6634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L10:;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":6635
 *         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":6638
 * 
 *     #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 = 6638; __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":6639
 *     #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 = 6639; __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 = 6639; __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 = 6639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6640
 *     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 = 6640; __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 = 6640; __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":6641
 *     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 = 6641; __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 = 6641; __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 = 6641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6642
 *         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 = 6642; __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 = 6642; __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":6645
 *     else:
 *         #Delete the XML
 *         if allocated_xml:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free(_fmu)
 * 
 */
    if (__pyx_v_allocated_xml) {

      /* "pyfmi\fmi.pyx":6646
 *         #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":6649
 * 
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    if (__pyx_v_allocated_context) {

      /* "pyfmi\fmi.pyx":6650
 *         #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":6652
 *             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 = 6652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_373), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6652; __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 = 6652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L11:;

  /* "pyfmi\fmi.pyx":6655
 * 
 *     #Delete the XML
 *     if allocated_xml:             # <<<<<<<<<<<<<<
 *         FMIL.fmi1_import_free(_fmu)
 * 
 */
  if (__pyx_v_allocated_xml) {

    /* "pyfmi\fmi.pyx":6656
 *     #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":6659
 * 
 *     #Delete the context
 *     if allocated_context:             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_free_context(context)
 * 
 */
  if (__pyx_v_allocated_context) {

    /* "pyfmi\fmi.pyx":6660
 *     #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":6663
 * 
 *     #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 = 6663; __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 = 6663; __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 = 6663; __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":6665
 *     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 = 6667; __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 = 6667; __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 = 6667; __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":6667
 *     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":6668
 * 
 * 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 = 6668; __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":6669
 * 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 = 6669; __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 = 6669; __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 = 6669; __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 = 6669; __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 = 6669; __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":6670
 *     log = []
 *     with open(log_file,'r') as file:
 *         while True:             # <<<<<<<<<<<<<<
 *             line = file.readline()
 *             if line == "":
 */
          while (1) {
            if (!1) break;

            /* "pyfmi\fmi.pyx":6671
 *     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 = 6671; __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 = 6671; __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":6672
 *         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_7), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6672; __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 = 6672; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (__pyx_t_8) {

              /* "pyfmi\fmi.pyx":6673
 *             line = file.readline()
 *             if line == "":
 *                 break             # <<<<<<<<<<<<<<
 *             log.append(line.strip("\n"))
 * 
 */
              goto __pyx_L17_break;
              goto __pyx_L18;
            }
            __pyx_L18:;

            /* "pyfmi\fmi.pyx":6674
 *             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 = 6674; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_374), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6674; __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 = 6674; __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":6669
 * 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 = 6669; __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 = 6669; __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 = 6669; __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 = 6669; __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 = 6669; __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_375, NULL);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6669; __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 = 6669; __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":6676
 *             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 = 6676; __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 = 6676; __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 = 6676; __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 = 6676; __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 = 6676; __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 = 6676; __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 = 6676; __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 = 6676; __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 = 6676; __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 = 6676; __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":6677
 * 
 *     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 = 6677; __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 = 6677; __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_15);

    /* "pyfmi\fmi.pyx":6679
 *         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_7);
    values[4] = ((PyObject *)__pyx_n_s__auto);
    values[5] = __pyx_k_376;
    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 = 6679; __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 = 6679; __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":6733
 * 
 *     #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":6734
 *     #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":6735
 *     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 = 6735; __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 = 6735; __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 = 6735; __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 = 6735; __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 = 6735; __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":6736
 *     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 = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_log_file_c = ((char *)malloc(((strlen(__pyx_t_4) + 1) * (sizeof(char)))));

  /* "pyfmi\fmi.pyx":6737
 *     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 = 6737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_log_file_c, __pyx_t_4);

  /* "pyfmi\fmi.pyx":6740
 * 
 *     # 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 = 6740; __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 = 6740; __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 = 6740; __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 = 6740; __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 = 6740; __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 = 6740; __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 = 6740; __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 = 6740; __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 = 6740; __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 = 6740; __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":6741
 *     # 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 = 6741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_377), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6741; __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 = 6741; __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":6742
 *     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 = 6742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_378), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6742; __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 = 6742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6745
 * 
 *     #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 = 6745; __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 = 6745; __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 = 6745; __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 = 6745; __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 = 6745; __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 = 6745; __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":6746
 *     #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 = 6746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_379), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6746; __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 = 6746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":6749
 * 
 *     #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 = 6749; __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 = 6749; __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 = 6749; __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 = 6749; __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":6750
 *     #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 = 6750; __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 = 6750; __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 = 6750; __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 = 6750; __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 = 6750; __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 = 6750; __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 = 6750; __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 = 6750; __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":6751
 *     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 = 6751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_380), __pyx_v_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6751; __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 = 6751; __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 = 6751; __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 = 6751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":6755
 * 
 *     #Specify FMI related callbacks
 *     callbacks.malloc    = FMIL.malloc             # <<<<<<<<<<<<<<
 *     callbacks.calloc    = FMIL.calloc
 *     callbacks.realloc   = FMIL.realloc
 */
  __pyx_v_callbacks.malloc = malloc;

  /* "pyfmi\fmi.pyx":6756
 *     #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":6757
 *     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":6758
 *     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":6759
 *     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":6760
 *     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":6762
 *     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":6764
 *     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 = 6764; __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 = 6764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":6765
 * 
 *     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 = 6765; __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 = 6765; __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 = 6765; __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 = 6765; __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 = 6765; __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 = 6765; __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":6766
 *     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 = 6766; __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 = 6766; __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 = 6766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {

        /* "pyfmi\fmi.pyx":6767
 *         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 = 6767; __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":6769
 *                 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 = 6769; __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":6770
 *             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 = 6770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_callbacks.log_level = __pyx_t_9;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6772
 *             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 = 6772; __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 = 6772; __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 = 6772; __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 = 6772; __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_17), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6772; __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 = 6772; __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 = 6772; __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 = 6772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L8:;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6774
 *             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 = 6774; __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 = 6774; __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_381), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6774; __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":6775
 *     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 = 6775; __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":6784
 * 
 *     #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":6785
 *     #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":6786
 *     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":6789
 * 
 *     #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":6790
 *     #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":6791
 *     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":6795
 * 
 *     # 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":6798
 * 
 *     #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 = 6798; __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 = 6798; __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 = 6798; __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 = 6798; __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 = 6798; __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":6799
 *     #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 = 6799; __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 = 6799; __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 = 6799; __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":6800
 *     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 = 6800; __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 = 6800; __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":6804
 * 
 *     #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":6806
 *     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":6807
 *         #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":6808
 *         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 = 6808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

    /* "pyfmi\fmi.pyx":6809
 *         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":6810
 *         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_382); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6810; __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 = 6810; __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 = 6810; __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":6811
 *         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 = 6811; __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 = 6811; __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 = 6811; __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 = 6811; __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 = 6811; __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_24), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6811; __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 = 6811; __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 = 6811; __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 = 6811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6813
 *             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_382); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6813; __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 = 6813; __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 = 6813; __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":6814
 *         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 = 6814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_383), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6814; __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 = 6814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L11:;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "pyfmi\fmi.pyx":6816
 *             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":6818
 *     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":6819
 *         #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":6820
 *         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 = 6820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

    /* "pyfmi\fmi.pyx":6821
 *         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":6822
 *         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_382); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6822; __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 = 6822; __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 = 6822; __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":6823
 *         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 = 6823; __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 = 6823; __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 = 6823; __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 = 6823; __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 = 6823; __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_384), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6823; __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 = 6823; __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 = 6823; __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 = 6823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L13;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6825
 *             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_382); 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_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6825; __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 = 6825; __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":6826
 *         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 = 6826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_386), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6826; __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 = 6826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L13:;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pyfmi\fmi.pyx":6830
 * 
 *     #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":6832
 *     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 = 6832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmu_1 = fmi1_import_parse_xml(__pyx_v_context, __pyx_t_10);

    /* "pyfmi\fmi.pyx":6834
 *         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":6836
 *         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":6837
 *             #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":6838
 *             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 = 6838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":6839
 *             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":6840
 *             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_382); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6840; __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 = 6840; __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 = 6840; __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":6841
 *             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 = 6841; __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 = 6841; __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 = 6841; __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 = 6841; __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 = 6841; __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_192), __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6841; __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 = 6841; __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 = 6841; __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 = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L16;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":6843
 *                 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_382); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6843; __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 = 6843; __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 = 6843; __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":6844
 *             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 = 6844; __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 = 6844; __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 = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L16:;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "pyfmi\fmi.pyx":6846
 *                 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":6849
 * 
 *         #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 = 6849; __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 = 6849; __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 = 6849; __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 = 6849; __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 = 6849; __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 = 6849; __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 = 6849; __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 = 6849; __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":6850
 *         #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 = 6850; __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 = 6850; __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":6851
 *         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 = 6851; __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 = 6851; __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 = 6851; __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 = 6851; __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 = 6851; __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 = 6851; __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 = 6851; __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 = 6851; __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":6852
 *             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 = 6852; __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 = 6852; __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":6853
 *         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":6854
 *             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":6855
 *         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":6856
 *             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 = 6856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":6857
 *             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_382); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6857; __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 = 6857; __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 = 6857; __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":6858
 *             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 = 6858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_389), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6858; __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 = 6858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L17;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6860
 *             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":6861
 *         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":6862
 *             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 = 6862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":6863
 *             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_382); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6863; __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 = 6863; __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 = 6863; __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":6864
 *             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 = 6864; __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 = 6864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_390), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6864; __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_391)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6864; __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 = 6864; __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 = 6864; __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 = 6864; __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 = 6864; __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 = 6864; __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 = 6864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L17:;
    goto __pyx_L14;
  }

  /* "pyfmi\fmi.pyx":6866
 *             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":6868
 *     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 = 6868; __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":6870
 *         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":6872
 *         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":6873
 *             #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":6874
 *             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 = 6874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":6875
 *             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":6876
 *             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_382); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6876; __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 = 6876; __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 = 6876; __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":6877
 *             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 = 6877; __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 = 6877; __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 = 6877; __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 = 6877; __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 = 6877; __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_192), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6877; __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 = 6877; __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 = 6877; __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 = 6877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L19;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":6879
 *                 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_382); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6879; __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 = 6879; __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 = 6879; __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":6880
 *             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 = 6880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_392), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6880; __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 = 6880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L19:;
      goto __pyx_L18;
    }
    __pyx_L18:;

    /* "pyfmi\fmi.pyx":6882
 *                 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":6885
 * 
 *         #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":6886
 *         #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":6887
 *         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":6888
 *             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":6889
 *             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 = 6889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":6890
 *             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":6891
 *             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_382); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6891; __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 = 6891; __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 = 6891; __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":6892
 *             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 = 6892; __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 = 6892; __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 = 6892; __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 = 6892; __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 = 6892; __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_195), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6892; __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 = 6892; __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 = 6892; __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 = 6892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L21;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":6894
 *                 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_382); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6894; __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 = 6894; __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 = 6894; __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":6895
 *             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 = 6895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_393), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6895; __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 = 6895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L21:;
      goto __pyx_L20;
    }
    __pyx_L20:;

    /* "pyfmi\fmi.pyx":6898
 * 
 *         #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 = 6898; __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 = 6898; __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 = 6898; __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 = 6898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":6899
 *         #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":6900
 *         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 = 6900; __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 = 6900; __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":6901
 *             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":6902
 *                 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 = 6902; __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 = 6902; __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":6903
 *             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 = 6903; __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 = 6903; __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 = 6903; __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 = 6903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6904
 *                 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":6905
 *         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 = 6905; __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 = 6905; __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":6906
 *             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 = 6906; __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 = 6906; __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 = 6906; __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 = 6906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_7) {

      /* "pyfmi\fmi.pyx":6907
 *                 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":6908
 *         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 = 6908; __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 = 6908; __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":6911
 * 
 *         #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":6912
 *         #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":6913
 *         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":6914
 *             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 = 6914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":6915
 *             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_382); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6915; __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 = 6915; __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 = 6915; __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":6916
 *             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 = 6916; __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 = 6916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_390), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6916; __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_391)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6916; __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 = 6916; __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 = 6916; __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 = 6916; __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 = 6916; __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 = 6916; __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 = 6916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L26;
    }
    __pyx_L26:;
    goto __pyx_L14;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6922
 * 
 *         #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":6923
 *         #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":6924
 *         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 = 6924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

    /* "pyfmi\fmi.pyx":6925
 *         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":6926
 *         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_382); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6926; __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 = 6926; __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 = 6926; __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":6927
 *         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 = 6927; __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 = 6927; __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 = 6927; __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 = 6927; __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 = 6927; __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_394), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6927; __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 = 6927; __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 = 6927; __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 = 6927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L27;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6929
 *             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_382); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6929; __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 = 6929; __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 = 6929; __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":6930
 *         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 = 6930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_396), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6930; __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 = 6930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L27:;
  }
  __pyx_L14:;

  /* "pyfmi\fmi.pyx":6933
 * 
 *     #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":6934
 *     #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":6935
 *     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":6936
 *         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 = 6936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);
    goto __pyx_L28;
  }
  __pyx_L28:;

  /* "pyfmi\fmi.pyx":6938
 *         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":6939
 * 
 *     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":6940
 *     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":6941
 *         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 = 6941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);
    goto __pyx_L29;
  }
  __pyx_L29:;

  /* "pyfmi\fmi.pyx":6944
 * 
 *     #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 = 6944; __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 = 6944; __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 = 6944; __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":6945
 *     #Delete log file
 *     delete_temp_file(log_file)
 *     FMIL.free(log_file_c)             # <<<<<<<<<<<<<<
 * 
 *     return model
 */
  free(__pyx_v_log_file_c);

  /* "pyfmi\fmi.pyx":6947
 *     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_398), 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_400), 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_402), 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_403), __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_405), 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_406), 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_408), 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_403), __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 PyObject *__pyx_tp_new_5pyfmi_3fmi_ModelBase(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_ModelBase(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

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)},
  {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, /*tp_flags*/
  __Pyx_DOCSTR("\n    Abstract Model class containing base functionality.\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_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_vtab = __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->_log = ((PyObject*)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->_log);
  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 = ((likely(__pyx_ptype_5pyfmi_3fmi_ModelBase)) ? ((__pyx_ptype_5pyfmi_3fmi_ModelBase->tp_traverse) ? __pyx_ptype_5pyfmi_3fmi_ModelBase->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase)); 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->_log) {
    e = (*v)(p->_log, 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;
  if (likely(__pyx_ptype_5pyfmi_3fmi_ModelBase)) { if (__pyx_ptype_5pyfmi_3fmi_ModelBase->tp_clear) __pyx_ptype_5pyfmi_3fmi_ModelBase->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase);
  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->_log);
  p->_log = ((PyObject*)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("append_log_message"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3append_log_message, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_log"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_5get_log, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_4get_log)},
  {__Pyx_NAMESTR("_internal_set_fmu_null"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_7_internal_set_fmu_null, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_6_internal_set_fmu_null)},
  {__Pyx_NAMESTR("print_log"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_9print_log, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_8print_log)},
  {__Pyx_NAMESTR("_convert_filter"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_11_convert_filter, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_10_convert_filter)},
  {__Pyx_NAMESTR("_get_version"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_13_get_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_12_get_version)},
  {__Pyx_NAMESTR("get_ode_sizes"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15get_ode_sizes, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_14get_ode_sizes)},
  {__Pyx_NAMESTR("get_real"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_17get_real, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_16get_real)},
  {__Pyx_NAMESTR("set_real"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_19set_real, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_18set_real)},
  {__Pyx_NAMESTR("get_integer"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_21get_integer, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_20get_integer)},
  {__Pyx_NAMESTR("set_integer"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23set_integer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_22set_integer)},
  {__Pyx_NAMESTR("get_boolean"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_25get_boolean, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_24get_boolean)},
  {__Pyx_NAMESTR("set_boolean"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_27set_boolean, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_26set_boolean)},
  {__Pyx_NAMESTR("get_string"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_29get_string, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_28get_string)},
  {__Pyx_NAMESTR("set_string"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_31set_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_30set_string)},
  {__Pyx_NAMESTR("set_debug_logging"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_33set_debug_logging, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_32set_debug_logging)},
  {__Pyx_NAMESTR("set_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35set_log_level, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_34set_log_level)},
  {__Pyx_NAMESTR("set_fmil_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37set_fmil_log_level, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_set"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_38_set)},
  {__Pyx_NAMESTR("_get"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41_get, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_40_get)},
  {__Pyx_NAMESTR("get_variable_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_description, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_42get_variable_description)},
  {__Pyx_NAMESTR("get_variable_data_type"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_data_type, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_44get_variable_data_type)},
  {__Pyx_NAMESTR("get_variable_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_valueref, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_46get_variable_valueref)},
  {__Pyx_NAMESTR("get_variable_nominal"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_variable_nominal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_48get_variable_nominal)},
  {__Pyx_NAMESTR("get_variable_fixed"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51get_variable_fixed, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_50get_variable_fixed)},
  {__Pyx_NAMESTR("get_variable_start"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_variable_start, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_52get_variable_start)},
  {__Pyx_NAMESTR("get_variable_max"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_max, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_54get_variable_max)},
  {__Pyx_NAMESTR("get_variable_min"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_min, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_56get_variable_min)},
  {__Pyx_NAMESTR("get_model_variables"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_59get_model_variables, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_58get_model_variables)},
  {__Pyx_NAMESTR("get_model_time_varying_value_references"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_model_time_varying_value_references, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_60get_model_time_varying_value_references)},
  {__Pyx_NAMESTR("get_variable_alias_base"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_63get_variable_alias_base, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_62get_variable_alias_base)},
  {__Pyx_NAMESTR("get_variable_alias"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_variable_alias, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_64get_variable_alias)},
  {__Pyx_NAMESTR("get_variable_variability"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_variable_variability, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_66get_variable_variability)},
  {__Pyx_NAMESTR("get_variable_by_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_variable_by_valueref, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_68get_variable_by_valueref)},
  {__Pyx_NAMESTR("get_variable_causality"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_variable_causality, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_70get_variable_causality)},
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_73get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_72get_name)},
  {__Pyx_NAMESTR("get_identifier"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_75get_identifier, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_74get_identifier)},
  {__Pyx_NAMESTR("get_author"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_77get_author, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_76get_author)},
  {__Pyx_NAMESTR("get_default_experiment_start_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_79get_default_experiment_start_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_78get_default_experiment_start_time)},
  {__Pyx_NAMESTR("get_default_experiment_stop_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_81get_default_experiment_stop_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_80get_default_experiment_stop_time)},
  {__Pyx_NAMESTR("get_default_experiment_tolerance"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_83get_default_experiment_tolerance, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_82get_default_experiment_tolerance)},
  {__Pyx_NAMESTR("get_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_85get_description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_84get_description)},
  {__Pyx_NAMESTR("get_generation_tool"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_87get_generation_tool, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_86get_generation_tool)},
  {__Pyx_NAMESTR("get_guid"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_89get_guid, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_88get_guid)},
  {__Pyx_NAMESTR("estimate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_91estimate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_90estimate)},
  {__Pyx_NAMESTR("estimate_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_93estimate_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_92estimate_options)},
  {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_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase*)__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)},
  {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_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase*)__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)},
  {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_vtab = __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2;
  p->_log = ((PyObject*)Py_None); Py_INCREF(Py_None);
  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->_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->_log);
  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->_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 = ((likely(__pyx_ptype_5pyfmi_3fmi_ModelBase)) ? ((__pyx_ptype_5pyfmi_3fmi_ModelBase->tp_traverse) ? __pyx_ptype_5pyfmi_3fmi_ModelBase->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase2)); if (e) return e;
  if (p->_log) {
    e = (*v)(p->_log, 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->_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;
  if (likely(__pyx_ptype_5pyfmi_3fmi_ModelBase)) { if (__pyx_ptype_5pyfmi_3fmi_ModelBase->tp_clear) __pyx_ptype_5pyfmi_3fmi_ModelBase->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase2);
  tmp = ((PyObject*)p->_log);
  p->_log = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  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->_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("get_log"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23get_log, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_22get_log)},
  {__Pyx_NAMESTR("print_log"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_25print_log, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_24print_log)},
  {__Pyx_NAMESTR("instantiate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_27instantiate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_26instantiate)},
  {__Pyx_NAMESTR("setup_experiment"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_29setup_experiment, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_28setup_experiment)},
  {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_31reset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_30reset)},
  {__Pyx_NAMESTR("terminate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_33terminate, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_32terminate)},
  {__Pyx_NAMESTR("exit_initialization_mode"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_35exit_initialization_mode, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_34exit_initialization_mode)},
  {__Pyx_NAMESTR("enter_initialization_mode"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_37enter_initialization_mode, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_36enter_initialization_mode)},
  {__Pyx_NAMESTR("initialize"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_39initialize, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_38initialize)},
  {__Pyx_NAMESTR("set_fmil_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_41set_fmil_log_level, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_40set_fmil_log_level)},
  {__Pyx_NAMESTR("get_fmil_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_43get_fmil_log_level, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_42get_fmil_log_level)},
  {__Pyx_NAMESTR("set_debug_logging"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_45set_debug_logging, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_44set_debug_logging)},
  {__Pyx_NAMESTR("get_categories"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_47get_categories, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_46get_categories)},
  {__Pyx_NAMESTR("get_variable_nominal"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_49get_variable_nominal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_48get_variable_nominal)},
  {__Pyx_NAMESTR("get_variable_by_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_51get_variable_by_valueref, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_50get_variable_by_valueref)},
  {__Pyx_NAMESTR("get_variable_alias_base"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_53get_variable_alias_base, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_52get_variable_alias_base)},
  {__Pyx_NAMESTR("get_variable_alias"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_55get_variable_alias, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_54get_variable_alias)},
  {__Pyx_NAMESTR("get_model_time_varying_value_references"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_57get_model_time_varying_value_references, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_56get_model_time_varying_value_references)},
  {__Pyx_NAMESTR("get_model_variables"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_59get_model_variables, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_58get_model_variables)},
  {__Pyx_NAMESTR("get_variable_references"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_references, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_60get_variable_references)},
  {__Pyx_NAMESTR("get_variable_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_valueref, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_62get_variable_valueref)},
  {__Pyx_NAMESTR("get_variable_data_type"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_65get_variable_data_type, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_64get_variable_data_type)},
  {__Pyx_NAMESTR("get_variable_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67get_variable_description, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_66get_variable_description)},
  {__Pyx_NAMESTR("get_variable_variability"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_69get_variable_variability, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_68get_variable_variability)},
  {__Pyx_NAMESTR("get_variable_initial"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71get_variable_initial, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_70get_variable_initial)},
  {__Pyx_NAMESTR("get_variable_causality"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73get_variable_causality, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_72get_variable_causality)},
  {__Pyx_NAMESTR("get_variable_start"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_75get_variable_start, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_74get_variable_start)},
  {__Pyx_NAMESTR("get_variable_max"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_77get_variable_max, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_76get_variable_max)},
  {__Pyx_NAMESTR("get_variable_min"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_79get_variable_min, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_78get_variable_min)},
  {__Pyx_NAMESTR("get_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_81get_fmu_state, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_80get_fmu_state)},
  {__Pyx_NAMESTR("set_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_83set_fmu_state, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_82set_fmu_state)},
  {__Pyx_NAMESTR("free_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_85free_fmu_state, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_84free_fmu_state)},
  {__Pyx_NAMESTR("serialize_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_87serialize_fmu_state, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_86serialize_fmu_state)},
  {__Pyx_NAMESTR("deserialize_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_89deserialize_fmu_state, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_88deserialize_fmu_state)},
  {__Pyx_NAMESTR("serialized_fmu_state_size"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_91serialized_fmu_state_size, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_90serialized_fmu_state_size)},
  {__Pyx_NAMESTR("get_ode_sizes"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_93get_ode_sizes, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_92get_ode_sizes)},
  {__Pyx_NAMESTR("get_default_experiment_start_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_95get_default_experiment_start_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_94get_default_experiment_start_time)},
  {__Pyx_NAMESTR("get_default_experiment_stop_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_97get_default_experiment_stop_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_96get_default_experiment_stop_time)},
  {__Pyx_NAMESTR("get_default_experiment_tolerance"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_99get_default_experiment_tolerance, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_98get_default_experiment_tolerance)},
  {__Pyx_NAMESTR("get_default_experiment_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_101get_default_experiment_step, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_100get_default_experiment_step)},
  {__Pyx_NAMESTR("_convert_filter"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_103_convert_filter, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_102_convert_filter)},
  {__Pyx_NAMESTR("get_derivatives_list"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_105get_derivatives_list, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_104get_derivatives_list)},
  {__Pyx_NAMESTR("get_output_dependencies"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_107get_output_dependencies, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_106get_output_dependencies)},
  {__Pyx_NAMESTR("get_derivatives_dependencies"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_109get_derivatives_dependencies, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_108get_derivatives_dependencies)},
  {__Pyx_NAMESTR("_get_directional_proxy"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_111_get_directional_proxy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_A"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_113_get_A, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_B"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_115_get_B, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_C"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_117_get_C, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_D"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_119_get_D, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_state_space_representation"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_121get_state_space_representation, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_120get_state_space_representation)},
  {__Pyx_NAMESTR("get_states_list"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_123get_states_list, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_122get_states_list)},
  {__Pyx_NAMESTR("get_input_list"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_125get_input_list, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_124get_input_list)},
  {__Pyx_NAMESTR("get_output_list"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_127get_output_list, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_126get_output_list)},
  {__Pyx_NAMESTR("get_directional_derivative"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_129get_directional_derivative, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_128get_directional_derivative)},
  {__Pyx_NAMESTR("get_version"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_131get_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_130get_version)},
  {__Pyx_NAMESTR("get_model_version"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_133get_model_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_132get_model_version)},
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_135get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_134get_name)},
  {__Pyx_NAMESTR("get_author"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_137get_author, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_136get_author)},
  {__Pyx_NAMESTR("get_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_139get_description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_138get_description)},
  {__Pyx_NAMESTR("get_copyright"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_141get_copyright, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_140get_copyright)},
  {__Pyx_NAMESTR("get_license"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_143get_license, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_142get_license)},
  {__Pyx_NAMESTR("get_generation_tool"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_145get_generation_tool, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_144get_generation_tool)},
  {__Pyx_NAMESTR("get_generation_date_and_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_147get_generation_date_and_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_146get_generation_date_and_time)},
  {__Pyx_NAMESTR("get_guid"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_149get_guid, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_148get_guid)},
  {__Pyx_NAMESTR("get_variable_naming_convention"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_151get_variable_naming_convention, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_150get_variable_naming_convention)},
  {__Pyx_NAMESTR("get_identifier"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_153get_identifier, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_152get_identifier)},
  {__Pyx_NAMESTR("get_model_types_platform"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_155get_model_types_platform, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_154get_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_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2*)__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_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2*)__pyx_vtabptr_5pyfmi_3fmi_FMUModelME2;
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelME2(PyObject *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);
  }
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase2(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)},
  {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_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_FMUModelME2, /*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_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_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase*)__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 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_409), /* 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_kp_s_100, __pyx_k_100, sizeof(__pyx_k_100), 0, 0, 1, 0},
  {&__pyx_kp_s_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 1, 0},
  {&__pyx_kp_s_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 1, 0},
  {&__pyx_kp_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 0},
  {&__pyx_kp_s_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 1, 0},
  {&__pyx_kp_s_109, __pyx_k_109, sizeof(__pyx_k_109), 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_116, __pyx_k_116, sizeof(__pyx_k_116), 0, 0, 1, 0},
  {&__pyx_n_s_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 0, 1, 1},
  {&__pyx_n_s_120, __pyx_k_120, sizeof(__pyx_k_120), 0, 0, 1, 1},
  {&__pyx_n_s_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 0, 1, 1},
  {&__pyx_kp_s_125, __pyx_k_125, sizeof(__pyx_k_125), 0, 0, 1, 0},
  {&__pyx_kp_s_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 0, 1, 0},
  {&__pyx_n_s_130, __pyx_k_130, sizeof(__pyx_k_130), 0, 0, 1, 1},
  {&__pyx_kp_s_131, __pyx_k_131, sizeof(__pyx_k_131), 0, 0, 1, 0},
  {&__pyx_kp_s_133, __pyx_k_133, sizeof(__pyx_k_133), 0, 0, 1, 0},
  {&__pyx_n_s_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 0, 1, 1},
  {&__pyx_n_s_136, __pyx_k_136, sizeof(__pyx_k_136), 0, 0, 1, 1},
  {&__pyx_n_s_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 1, 1},
  {&__pyx_n_s_138, __pyx_k_138, sizeof(__pyx_k_138), 0, 0, 1, 1},
  {&__pyx_n_s_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 0, 1, 1},
  {&__pyx_n_s_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 0, 1, 1},
  {&__pyx_kp_s_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 0, 1, 0},
  {&__pyx_kp_s_144, __pyx_k_144, sizeof(__pyx_k_144), 0, 0, 1, 0},
  {&__pyx_kp_s_146, __pyx_k_146, sizeof(__pyx_k_146), 0, 0, 1, 0},
  {&__pyx_kp_s_148, __pyx_k_148, sizeof(__pyx_k_148), 0, 0, 1, 0},
  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
  {&__pyx_kp_s_150, __pyx_k_150, sizeof(__pyx_k_150), 0, 0, 1, 0},
  {&__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_157, __pyx_k_157, sizeof(__pyx_k_157), 0, 0, 1, 0},
  {&__pyx_n_s_159, __pyx_k_159, sizeof(__pyx_k_159), 0, 0, 1, 1},
  {&__pyx_n_s_160, __pyx_k_160, sizeof(__pyx_k_160), 0, 0, 1, 1},
  {&__pyx_kp_s_162, __pyx_k_162, sizeof(__pyx_k_162), 0, 0, 1, 0},
  {&__pyx_n_s_163, __pyx_k_163, sizeof(__pyx_k_163), 0, 0, 1, 1},
  {&__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_169, __pyx_k_169, sizeof(__pyx_k_169), 0, 0, 1, 0},
  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
  {&__pyx_kp_s_171, __pyx_k_171, sizeof(__pyx_k_171), 0, 0, 1, 0},
  {&__pyx_kp_s_173, __pyx_k_173, sizeof(__pyx_k_173), 0, 0, 1, 0},
  {&__pyx_kp_s_175, __pyx_k_175, sizeof(__pyx_k_175), 0, 0, 1, 0},
  {&__pyx_kp_s_178, __pyx_k_178, sizeof(__pyx_k_178), 0, 0, 1, 0},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_kp_s_186, __pyx_k_186, sizeof(__pyx_k_186), 0, 0, 1, 0},
  {&__pyx_kp_s_189, __pyx_k_189, sizeof(__pyx_k_189), 0, 0, 1, 0},
  {&__pyx_kp_s_190, __pyx_k_190, sizeof(__pyx_k_190), 0, 0, 1, 0},
  {&__pyx_kp_s_192, __pyx_k_192, sizeof(__pyx_k_192), 0, 0, 1, 0},
  {&__pyx_kp_s_193, __pyx_k_193, sizeof(__pyx_k_193), 0, 0, 1, 0},
  {&__pyx_kp_s_195, __pyx_k_195, sizeof(__pyx_k_195), 0, 0, 1, 0},
  {&__pyx_kp_s_196, __pyx_k_196, sizeof(__pyx_k_196), 0, 0, 1, 0},
  {&__pyx_kp_s_198, __pyx_k_198, sizeof(__pyx_k_198), 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_218, __pyx_k_218, sizeof(__pyx_k_218), 0, 0, 1, 0},
  {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
  {&__pyx_kp_s_223, __pyx_k_223, sizeof(__pyx_k_223), 0, 0, 1, 0},
  {&__pyx_kp_s_225, __pyx_k_225, sizeof(__pyx_k_225), 0, 0, 1, 0},
  {&__pyx_kp_s_227, __pyx_k_227, sizeof(__pyx_k_227), 0, 0, 1, 0},
  {&__pyx_kp_s_229, __pyx_k_229, sizeof(__pyx_k_229), 0, 0, 1, 0},
  {&__pyx_kp_s_231, __pyx_k_231, sizeof(__pyx_k_231), 0, 0, 1, 0},
  {&__pyx_kp_s_233, __pyx_k_233, sizeof(__pyx_k_233), 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_24, __pyx_k_24, sizeof(__pyx_k_24), 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_n_s_245, __pyx_k_245, sizeof(__pyx_k_245), 0, 0, 1, 1},
  {&__pyx_n_s_246, __pyx_k_246, sizeof(__pyx_k_246), 0, 0, 1, 1},
  {&__pyx_kp_s_248, __pyx_k_248, sizeof(__pyx_k_248), 0, 0, 1, 0},
  {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
  {&__pyx_kp_s_251, __pyx_k_251, sizeof(__pyx_k_251), 0, 0, 1, 0},
  {&__pyx_n_s_259, __pyx_k_259, sizeof(__pyx_k_259), 0, 0, 1, 1},
  {&__pyx_n_s_263, __pyx_k_263, sizeof(__pyx_k_263), 0, 0, 1, 1},
  {&__pyx_kp_s_264, __pyx_k_264, sizeof(__pyx_k_264), 0, 0, 1, 0},
  {&__pyx_kp_s_266, __pyx_k_266, sizeof(__pyx_k_266), 0, 0, 1, 0},
  {&__pyx_kp_s_268, __pyx_k_268, sizeof(__pyx_k_268), 0, 0, 1, 0},
  {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
  {&__pyx_kp_s_270, __pyx_k_270, sizeof(__pyx_k_270), 0, 0, 1, 0},
  {&__pyx_kp_s_273, __pyx_k_273, sizeof(__pyx_k_273), 0, 0, 1, 0},
  {&__pyx_kp_s_274, __pyx_k_274, sizeof(__pyx_k_274), 0, 0, 1, 0},
  {&__pyx_n_s_276, __pyx_k_276, sizeof(__pyx_k_276), 0, 0, 1, 1},
  {&__pyx_n_s_277, __pyx_k_277, sizeof(__pyx_k_277), 0, 0, 1, 1},
  {&__pyx_kp_s_279, __pyx_k_279, sizeof(__pyx_k_279), 0, 0, 1, 0},
  {&__pyx_n_s_281, __pyx_k_281, sizeof(__pyx_k_281), 0, 0, 1, 1},
  {&__pyx_kp_s_282, __pyx_k_282, sizeof(__pyx_k_282), 0, 0, 1, 0},
  {&__pyx_n_s_284, __pyx_k_284, sizeof(__pyx_k_284), 0, 0, 1, 1},
  {&__pyx_kp_s_285, __pyx_k_285, sizeof(__pyx_k_285), 0, 0, 1, 0},
  {&__pyx_n_s_287, __pyx_k_287, sizeof(__pyx_k_287), 0, 0, 1, 1},
  {&__pyx_n_s_289, __pyx_k_289, sizeof(__pyx_k_289), 0, 0, 1, 1},
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
  {&__pyx_n_s_290, __pyx_k_290, sizeof(__pyx_k_290), 0, 0, 1, 1},
  {&__pyx_kp_s_295, __pyx_k_295, sizeof(__pyx_k_295), 0, 0, 1, 0},
  {&__pyx_kp_s_297, __pyx_k_297, sizeof(__pyx_k_297), 0, 0, 1, 0},
  {&__pyx_n_s_299, __pyx_k_299, sizeof(__pyx_k_299), 0, 0, 1, 1},
  {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
  {&__pyx_kp_s_300, __pyx_k_300, sizeof(__pyx_k_300), 0, 0, 1, 0},
  {&__pyx_kp_s_302, __pyx_k_302, sizeof(__pyx_k_302), 0, 0, 1, 0},
  {&__pyx_kp_s_304, __pyx_k_304, sizeof(__pyx_k_304), 0, 0, 1, 0},
  {&__pyx_kp_s_308, __pyx_k_308, sizeof(__pyx_k_308), 0, 0, 1, 0},
  {&__pyx_n_s_310, __pyx_k_310, sizeof(__pyx_k_310), 0, 0, 1, 1},
  {&__pyx_kp_s_311, __pyx_k_311, sizeof(__pyx_k_311), 0, 0, 1, 0},
  {&__pyx_kp_s_314, __pyx_k_314, sizeof(__pyx_k_314), 0, 0, 1, 0},
  {&__pyx_kp_s_322, __pyx_k_322, sizeof(__pyx_k_322), 0, 0, 1, 0},
  {&__pyx_kp_s_324, __pyx_k_324, sizeof(__pyx_k_324), 0, 0, 1, 0},
  {&__pyx_n_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 1},
  {&__pyx_n_s_335, __pyx_k_335, sizeof(__pyx_k_335), 0, 0, 1, 1},
  {&__pyx_n_s_336, __pyx_k_336, sizeof(__pyx_k_336), 0, 0, 1, 1},
  {&__pyx_n_s_337, __pyx_k_337, sizeof(__pyx_k_337), 0, 0, 1, 1},
  {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
  {&__pyx_kp_s_340, __pyx_k_340, sizeof(__pyx_k_340), 0, 0, 1, 0},
  {&__pyx_n_s_344, __pyx_k_344, sizeof(__pyx_k_344), 0, 0, 1, 1},
  {&__pyx_n_s_345, __pyx_k_345, sizeof(__pyx_k_345), 0, 0, 1, 1},
  {&__pyx_n_s_346, __pyx_k_346, sizeof(__pyx_k_346), 0, 0, 1, 1},
  {&__pyx_n_s_347, __pyx_k_347, sizeof(__pyx_k_347), 0, 0, 1, 1},
  {&__pyx_kp_s_348, __pyx_k_348, sizeof(__pyx_k_348), 0, 0, 1, 0},
  {&__pyx_kp_s_350, __pyx_k_350, sizeof(__pyx_k_350), 0, 0, 1, 0},
  {&__pyx_n_s_354, __pyx_k_354, sizeof(__pyx_k_354), 0, 0, 1, 1},
  {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
  {&__pyx_n_s_362, __pyx_k_362, sizeof(__pyx_k_362), 0, 0, 1, 1},
  {&__pyx_n_s_363, __pyx_k_363, sizeof(__pyx_k_363), 0, 0, 1, 1},
  {&__pyx_kp_s_365, __pyx_k_365, sizeof(__pyx_k_365), 0, 0, 1, 0},
  {&__pyx_kp_s_370, __pyx_k_370, sizeof(__pyx_k_370), 0, 0, 1, 0},
  {&__pyx_kp_s_380, __pyx_k_380, sizeof(__pyx_k_380), 0, 0, 1, 0},
  {&__pyx_n_s_382, __pyx_k_382, sizeof(__pyx_k_382), 0, 0, 1, 1},
  {&__pyx_kp_s_384, __pyx_k_384, sizeof(__pyx_k_384), 0, 0, 1, 0},
  {&__pyx_kp_s_385, __pyx_k_385, sizeof(__pyx_k_385), 0, 0, 1, 0},
  {&__pyx_kp_s_388, __pyx_k_388, sizeof(__pyx_k_388), 0, 0, 1, 0},
  {&__pyx_kp_s_390, __pyx_k_390, sizeof(__pyx_k_390), 0, 0, 1, 0},
  {&__pyx_kp_s_391, __pyx_k_391, sizeof(__pyx_k_391), 0, 0, 1, 0},
  {&__pyx_kp_s_394, __pyx_k_394, sizeof(__pyx_k_394), 0, 0, 1, 0},
  {&__pyx_kp_s_395, __pyx_k_395, sizeof(__pyx_k_395), 0, 0, 1, 0},
  {&__pyx_kp_u_397, __pyx_k_397, sizeof(__pyx_k_397), 0, 1, 0, 0},
  {&__pyx_kp_u_399, __pyx_k_399, sizeof(__pyx_k_399), 0, 1, 0, 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_kp_u_401, __pyx_k_401, sizeof(__pyx_k_401), 0, 1, 0, 0},
  {&__pyx_kp_u_403, __pyx_k_403, sizeof(__pyx_k_403), 0, 1, 0, 0},
  {&__pyx_kp_u_404, __pyx_k_404, sizeof(__pyx_k_404), 0, 1, 0, 0},
  {&__pyx_kp_u_407, __pyx_k_407, sizeof(__pyx_k_407), 0, 1, 0, 0},
  {&__pyx_n_s_410, __pyx_k_410, sizeof(__pyx_k_410), 0, 0, 1, 1},
  {&__pyx_n_s_411, __pyx_k_411, sizeof(__pyx_k_411), 0, 0, 1, 1},
  {&__pyx_n_s_412, __pyx_k_412, sizeof(__pyx_k_412), 0, 0, 1, 1},
  {&__pyx_n_s_413, __pyx_k_413, sizeof(__pyx_k_413), 0, 0, 1, 1},
  {&__pyx_n_s_414, __pyx_k_414, sizeof(__pyx_k_414), 0, 0, 1, 1},
  {&__pyx_kp_s_417, __pyx_k_417, sizeof(__pyx_k_417), 0, 0, 1, 0},
  {&__pyx_n_s_418, __pyx_k_418, sizeof(__pyx_k_418), 0, 0, 1, 1},
  {&__pyx_kp_s_425, __pyx_k_425, sizeof(__pyx_k_425), 0, 0, 1, 0},
  {&__pyx_kp_s_426, __pyx_k_426, sizeof(__pyx_k_426), 0, 0, 1, 0},
  {&__pyx_n_s_427, __pyx_k_427, sizeof(__pyx_k_427), 0, 0, 1, 1},
  {&__pyx_kp_s_428, __pyx_k_428, sizeof(__pyx_k_428), 0, 0, 1, 0},
  {&__pyx_n_s_43, __pyx_k_43, sizeof(__pyx_k_43), 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_433, __pyx_k_433, sizeof(__pyx_k_433), 0, 0, 1, 0},
  {&__pyx_n_s_434, __pyx_k_434, sizeof(__pyx_k_434), 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_n_s_437, __pyx_k_437, sizeof(__pyx_k_437), 0, 0, 1, 1},
  {&__pyx_n_s_438, __pyx_k_438, sizeof(__pyx_k_438), 0, 0, 1, 1},
  {&__pyx_n_s_439, __pyx_k_439, sizeof(__pyx_k_439), 0, 0, 1, 1},
  {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
  {&__pyx_kp_s_440, __pyx_k_440, sizeof(__pyx_k_440), 0, 0, 1, 0},
  {&__pyx_n_s_441, __pyx_k_441, sizeof(__pyx_k_441), 0, 0, 1, 1},
  {&__pyx_kp_s_442, __pyx_k_442, sizeof(__pyx_k_442), 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_kp_s_445, __pyx_k_445, sizeof(__pyx_k_445), 0, 0, 1, 0},
  {&__pyx_n_s_450, __pyx_k_450, sizeof(__pyx_k_450), 0, 0, 1, 1},
  {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0},
  {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0},
  {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0},
  {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0},
  {&__pyx_kp_s_57, __pyx_k_57, sizeof(__pyx_k_57), 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_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 0},
  {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0},
  {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0},
  {&__pyx_kp_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 0},
  {&__pyx_kp_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 0},
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
  {&__pyx_n_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 1},
  {&__pyx_n_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 1},
  {&__pyx_n_s_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 0, 1, 1},
  {&__pyx_kp_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 0},
  {&__pyx_kp_s_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 1, 0},
  {&__pyx_kp_s_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 0, 1, 0},
  {&__pyx_kp_s_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 0, 1, 0},
  {&__pyx_kp_s_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 1, 0},
  {&__pyx_kp_s_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 0, 1, 0},
  {&__pyx_kp_s_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 1, 0},
  {&__pyx_n_s_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 1, 1},
  {&__pyx_kp_s_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 0, 1, 0},
  {&__pyx_n_s_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 0, 1, 1},
  {&__pyx_n_s_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 1, 1},
  {&__pyx_kp_s_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 1, 0},
  {&__pyx_kp_s_97, __pyx_k_97, sizeof(__pyx_k_97), 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__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__endswith, __pyx_k__endswith, sizeof(__pyx_k__endswith), 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__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__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_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__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 = 343; __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 = 379; __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_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __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 = 1066; __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":616
 *                 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_19 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_19);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));

  /* "pyfmi\fmi.pyx":625
 * 
 *         # 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_21 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_21);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));

  /* "pyfmi\fmi.pyx":626
 *         # 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_23 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_22)); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_23);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));

  /* "pyfmi\fmi.pyx":647
 *                 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_26 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_25)); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_26);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));

  /* "pyfmi\fmi.pyx":649
 *                 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_28 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_27)); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_28);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28));

  /* "pyfmi\fmi.pyx":658
 *                 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_31 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_30)); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_31);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31));

  /* "pyfmi\fmi.pyx":664
 *         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_32 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_27)); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_32);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));

  /* "pyfmi\fmi.pyx":675
 *                 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_35 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_34)); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_35);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));

  /* "pyfmi\fmi.pyx":698
 * 
 *         #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_37 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_37);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));

  /* "pyfmi\fmi.pyx":706
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string 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_38 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_38);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));

  /* "pyfmi\fmi.pyx":713
 *     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_39 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_39);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39));

  /* "pyfmi\fmi.pyx":738
 *                     if line == "":
 *                         break
 *                     log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 *         return log
 * 
 */
  __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 = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_41);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));

  /* "pyfmi\fmi.pyx":733
 *         log = []
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     line = file.readline()
 */
  __pyx_k_tuple_42 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_42);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42));

  /* "pyfmi\fmi.pyx":774
 *                 regexp.append(re.compile(regex))
 *         else:
 *             raise FMUException("Unknown input.")             # <<<<<<<<<<<<<<
 *         return regexp
 * 
 */
  __pyx_k_tuple_45 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_45);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45));

  /* "pyfmi\fmi.pyx":844
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
  __pyx_k_tuple_47 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_46)); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_47);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47));

  /* "pyfmi\fmi.pyx":873
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_49 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_48)); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_49);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));

  /* "pyfmi\fmi.pyx":879
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
  __pyx_k_tuple_51 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_50)); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_51);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));

  /* "pyfmi\fmi.pyx":911
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
  __pyx_k_tuple_53 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_52)); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_53);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53));

  /* "pyfmi\fmi.pyx":941
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_54 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_48)); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_54);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));

  /* "pyfmi\fmi.pyx":947
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_56 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_55)); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_56);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));

  /* "pyfmi\fmi.pyx":993
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         return N.array(return_values)
 */
  __pyx_k_tuple_58 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_58);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58));

  /* "pyfmi\fmi.pyx":1035
 * 
 *         if val_ref.size != values.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_59 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_48)); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_59);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));

  /* "pyfmi\fmi.pyx":1044
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
  __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 = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_61);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));

  /* "pyfmi\fmi.pyx":1152
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def set_log_level(self, FMIL.jm_log_level_enu_t level):
 */
  __pyx_k_tuple_63 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_63);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63));

  /* "pyfmi\fmi.pyx":1174
 *         """
 *         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_65 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_65);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));

  /* "pyfmi\fmi.pyx":1178
 * 
 *     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_67 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_66)); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_67);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));

  /* "pyfmi\fmi.pyx":1216
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_70 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_70);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_70));

  /* "pyfmi\fmi.pyx":1251
 *             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_71 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_71);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_71));

  /* "pyfmi\fmi.pyx":1365
 *                 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_77 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_76)); if (unlikely(!__pyx_k_tuple_77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_77);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_77));

  /* "pyfmi\fmi.pyx":1369
 *         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_79 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_78)); if (unlikely(!__pyx_k_tuple_79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_79);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_79));

  /* "pyfmi\fmi.pyx":1466
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self, variable_name):
 */
  __pyx_k_tuple_82 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_81)); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_82);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82));

  /* "pyfmi\fmi.pyx":1509
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self, variable_name):
 */
  __pyx_k_tuple_84 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_83)); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_84);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_84));

  /* "pyfmi\fmi.pyx":1552
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_86 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_85)); if (unlikely(!__pyx_k_tuple_86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_86);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_86));

  /* "pyfmi\fmi.pyx":2082
 * 
 *         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_98 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_97)); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_98);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98));

  /* "pyfmi\fmi.pyx":2210
 *                 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_102 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_101)); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_102);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_102));

  /* "pyfmi\fmi.pyx":2217
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_104 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_103)); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_104);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_104));

  /* "pyfmi\fmi.pyx":2249
 * 
 *             if status != 0:
 *                 raise FMUException('Failed to retrieve the last successful time. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *             return value
 */
  __pyx_k_tuple_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_105)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_106);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_106));

  /* "pyfmi\fmi.pyx":2253
 *             return value
 *         else:
 *             raise FMUException('Not supported status kind.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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 = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_108);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_108));

  /* "pyfmi\fmi.pyx":2282
 * 
 *         if nref != len(np_orders):
 *             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_110 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_109)); if (unlikely(!__pyx_k_tuple_110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_110);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_110));

  /* "pyfmi\fmi.pyx":2290
 *         for i in range(len(np_orders)):
 *             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_112 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_111)); if (unlikely(!__pyx_k_tuple_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_112);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_112));

  /* "pyfmi\fmi.pyx":2292
 *                 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_114 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_113)); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_114);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_114));

  /* "pyfmi\fmi.pyx":2302
 *                 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_115 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_101)); if (unlikely(!__pyx_k_tuple_115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_115);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_115));

  /* "pyfmi\fmi.pyx":2307
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
  __pyx_k_tuple_117 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_116)); if (unlikely(!__pyx_k_tuple_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_117);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_117));

  /* "pyfmi\fmi.pyx":2423
 * 
 *         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_126 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_125)); if (unlikely(!__pyx_k_tuple_126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_126);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_126));

  /* "pyfmi\fmi.pyx":2435
 *         status = FMIL.fmi1_import_reset_slave(self._fmu)
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("Failed to reset the FMU.")             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_k_tuple_128 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_127)); if (unlikely(!__pyx_k_tuple_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_128);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_128));

  /* "pyfmi\fmi.pyx":2475
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the slave. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *         #Just to be safe, some problems with Dymola (2012) FMUs not reacting
 */
  __pyx_k_tuple_132 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_131)); if (unlikely(!__pyx_k_tuple_132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_132);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_132));

  /* "pyfmi\fmi.pyx":2482
 * 
 *         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_134 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_133)); if (unlikely(!__pyx_k_tuple_134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_134);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_134));

  /* "pyfmi\fmi.pyx":2527
 * 
 *         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_143 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_142)); if (unlikely(!__pyx_k_tuple_143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_143);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_143));

  /* "pyfmi\fmi.pyx":2565
 *         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_145 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_144)); if (unlikely(!__pyx_k_tuple_145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_145);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_145));

  /* "pyfmi\fmi.pyx":2616
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 * 
 *     time = property(_get_time,_set_time, doc =
 */
  __pyx_k_tuple_147 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_146)); if (unlikely(!__pyx_k_tuple_147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_147);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_147));

  /* "pyfmi\fmi.pyx":2630
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_149 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_148)); if (unlikely(!__pyx_k_tuple_149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_149);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_149));

  /* "pyfmi\fmi.pyx":2639
 * 
 *         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_151 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_150)); if (unlikely(!__pyx_k_tuple_151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_151);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_151));

  /* "pyfmi\fmi.pyx":2647
 * 
 *         if status >= 3:
 *             raise FMUException('Failed to set the new continuous states.')             # <<<<<<<<<<<<<<
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,
 */
  __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 = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_153);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_153));

  /* "pyfmi\fmi.pyx":2664
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __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 = 2664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_155);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_155));

  /* "pyfmi\fmi.pyx":2720
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_158 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_157)); if (unlikely(!__pyx_k_tuple_158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_158);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_158));

  /* "pyfmi\fmi.pyx":2847
 * 
 *         if status != 0:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to get the continuous state reference values.')
 * 
 */
  __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 = 2847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_165);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_165));

  /* "pyfmi\fmi.pyx":2871
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         if callEventUpdate == 1:
 */
  __pyx_k_tuple_167 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_166)); if (unlikely(!__pyx_k_tuple_167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_167);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_167));

  /* "pyfmi\fmi.pyx":2918
 *         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_170 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_169)); if (unlikely(!__pyx_k_tuple_170)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_170);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_170));

  /* "pyfmi\fmi.pyx":2922
 *                     ' 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_172 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_171)); if (unlikely(!__pyx_k_tuple_172)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_172);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_172));

  /* "pyfmi\fmi.pyx":2927
 *         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_174 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_173)); if (unlikely(!__pyx_k_tuple_174)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_174);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_174));

  /* "pyfmi\fmi.pyx":2931
 *                     ' 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_176 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_175)); if (unlikely(!__pyx_k_tuple_176)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_176);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_176));

  /* "pyfmi\fmi.pyx":2965
 * 
 *         if status != 0:
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *         #Just to be safe, some problems with Dymola (2012) FMUs not reacting
 */
  __pyx_k_tuple_179 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_178)); if (unlikely(!__pyx_k_tuple_179)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_179);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_179));

  /* "pyfmi\fmi.pyx":2972
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
  __pyx_k_tuple_180 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_133)); if (unlikely(!__pyx_k_tuple_180)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_180);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_180));

  /* "pyfmi\fmi.pyx":3174
 *                 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_183 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_k_tuple_183)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_183);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_183));

  /* "pyfmi\fmi.pyx":3178
 * 
 *         # 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_184 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_k_tuple_184)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_184);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_184));

  /* "pyfmi\fmi.pyx":3179
 *         # 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_185 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_22)); if (unlikely(!__pyx_k_tuple_185)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_185);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_185));

  /* "pyfmi\fmi.pyx":3184
 *         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_187 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_186)); if (unlikely(!__pyx_k_tuple_187)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_187);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_187));

  /* "pyfmi\fmi.pyx":3202
 *                 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_188 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_25)); if (unlikely(!__pyx_k_tuple_188)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_188);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_188));

  /* "pyfmi\fmi.pyx":3209
 *                 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_191 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_190)); if (unlikely(!__pyx_k_tuple_191)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_191);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_191));

  /* "pyfmi\fmi.pyx":3219
 *                 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_194 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_193)); if (unlikely(!__pyx_k_tuple_194)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_194);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_194));

  /* "pyfmi\fmi.pyx":3232
 *                 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_197 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_196)); if (unlikely(!__pyx_k_tuple_197)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_197);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_197));

  /* "pyfmi\fmi.pyx":3239
 *                 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_199 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_198)); if (unlikely(!__pyx_k_tuple_199)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_199);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_199));

  /* "pyfmi\fmi.pyx":3248
 *                 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_201 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_34)); if (unlikely(!__pyx_k_tuple_201)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_201);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_201));

  /* "pyfmi\fmi.pyx":3261
 * 
 *         #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_202 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_202)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_202);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_202));

  /* "pyfmi\fmi.pyx":3297
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
  __pyx_k_tuple_203 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_46)); if (unlikely(!__pyx_k_tuple_203)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_203);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_203));

  /* "pyfmi\fmi.pyx":3328
 * 
 *         if len(input_valueref) != len(set_value):
 *             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, nref, <FMIL.fmi2_real_t*> set_value.data)
 */
  __pyx_k_tuple_204 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_48)); if (unlikely(!__pyx_k_tuple_204)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_204);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_204));

  /* "pyfmi\fmi.pyx":3333
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
  __pyx_k_tuple_205 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_50)); if (unlikely(!__pyx_k_tuple_205)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_205);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_205));

  /* "pyfmi\fmi.pyx":3366
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
  __pyx_k_tuple_206 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_52)); if (unlikely(!__pyx_k_tuple_206)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_206);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_206));

  /* "pyfmi\fmi.pyx":3397
 * 
 *         if len(input_valueref) != len(set_value):
 *             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_207 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_48)); if (unlikely(!__pyx_k_tuple_207)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_207);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_207));

  /* "pyfmi\fmi.pyx":3402
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_boolean(self, valueref):
 */
  __pyx_k_tuple_208 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_55)); if (unlikely(!__pyx_k_tuple_208)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_208);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_208));

  /* "pyfmi\fmi.pyx":3448
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         #return val==FMI_TRUE
 */
  __pyx_k_tuple_209 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_k_tuple_209)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_209);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_209));

  /* "pyfmi\fmi.pyx":3490
 * 
 *         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_210 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_48)); if (unlikely(!__pyx_k_tuple_210)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_210);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_210));

  /* "pyfmi\fmi.pyx":3498
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
  __pyx_k_tuple_211 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_60)); if (unlikely(!__pyx_k_tuple_211)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_211);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_211));

  /* "pyfmi\fmi.pyx":3591
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     def _get(self, variable_name):
 */
  __pyx_k_tuple_212 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_212);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_212));

  /* "pyfmi\fmi.pyx":3612
 *             return self.get_boolean([ref])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 */
  __pyx_k_tuple_213 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_213);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_213));

  /* "pyfmi\fmi.pyx":3616
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string 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_214 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_214)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_214);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_214));

  /* "pyfmi\fmi.pyx":3641
 *                     if line == "":
 *                         break
 *                     log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 *         return log
 * 
 */
  __pyx_k_tuple_215 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_40)); if (unlikely(!__pyx_k_tuple_215)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_215);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_215));

  /* "pyfmi\fmi.pyx":3636
 *         log = []
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     line = file.readline()
 */
  __pyx_k_tuple_216 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_216);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_216));

  /* "pyfmi\fmi.pyx":3687
 *             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_219 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_218)); if (unlikely(!__pyx_k_tuple_219)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_219);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_219));

  /* "pyfmi\fmi.pyx":3693
 * 
 *         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_220 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_178)); if (unlikely(!__pyx_k_tuple_220)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_220);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_220));

  /* "pyfmi\fmi.pyx":3726
 * 
 *         if status != 0:
 *             raise FMUException('Failed to setup the experiment.')             # <<<<<<<<<<<<<<
 * 
 *     def reset(self):
 */
  __pyx_k_tuple_224 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_223)); if (unlikely(!__pyx_k_tuple_224)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_224);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_224));

  /* "pyfmi\fmi.pyx":3737
 *         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_226 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_225)); if (unlikely(!__pyx_k_tuple_226)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_226);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_226));

  /* "pyfmi\fmi.pyx":3767
 *         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_228 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_227)); if (unlikely(!__pyx_k_tuple_228)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_228);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_228));

  /* "pyfmi\fmi.pyx":3771
 *                     ' 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_230 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_229)); if (unlikely(!__pyx_k_tuple_230)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_230);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_230));

  /* "pyfmi\fmi.pyx":3776
 *         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_232 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_231)); if (unlikely(!__pyx_k_tuple_232)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_232);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_232));

  /* "pyfmi\fmi.pyx":3780
 *                     ' 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_234 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_233)); if (unlikely(!__pyx_k_tuple_234)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_234);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_234));

  /* "pyfmi\fmi.pyx":3798
 *         """
 *         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_236 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_235)); if (unlikely(!__pyx_k_tuple_236)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_236);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_236));

  /* "pyfmi\fmi.pyx":3804
 *         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_238 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_237)); if (unlikely(!__pyx_k_tuple_238)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_238);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_238));

  /* "pyfmi\fmi.pyx":3808
 *                     ' 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_240 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_239)); if (unlikely(!__pyx_k_tuple_240)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_240);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_240));

  /* "pyfmi\fmi.pyx":3813
 *         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_242 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_241)); if (unlikely(!__pyx_k_tuple_242)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_242);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_242));

  /* "pyfmi\fmi.pyx":3817
 *                     ' 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_244 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_243)); if (unlikely(!__pyx_k_tuple_244)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_244);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_244));

  /* "pyfmi\fmi.pyx":3852
 *         """
 *         if level < 0 or level > 7:
 *             raise FMUException("Invalid log level for FMI Library (0-7).")             # <<<<<<<<<<<<<<
 *         self.callbacks.log_level = <FMIL.jm_log_level_enu_t> level
 * 
 */
  __pyx_k_tuple_247 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_247)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_247);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_247));

  /* "pyfmi\fmi.pyx":3868
 *             return level
 *         else:
 *             raise FMUException('Logging is not enabled')             # <<<<<<<<<<<<<<
 * 
 *     def set_debug_logging(self, logging_on, categories = []):
 */
  __pyx_k_tuple_249 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_248)); if (unlikely(!__pyx_k_tuple_249)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_249);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_249));

  /* "pyfmi\fmi.pyx":3901
 * 
 *         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_252 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_251)); if (unlikely(!__pyx_k_tuple_252)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_252);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_252));

  /* "pyfmi\fmi.pyx":3906
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def get_categories(self):
 */
  __pyx_k_tuple_253 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_253)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_253);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_253));

  /* "pyfmi\fmi.pyx":3961
 *                 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_254 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_76)); if (unlikely(!__pyx_k_tuple_254)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_254);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_254));

  /* "pyfmi\fmi.pyx":3965
 *         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_255 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_78)); if (unlikely(!__pyx_k_tuple_255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_255);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_255));

  /* "pyfmi\fmi.pyx":4561
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self, variable_name):
 */
  __pyx_k_tuple_260 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_81)); if (unlikely(!__pyx_k_tuple_260)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_260);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_260));

  /* "pyfmi\fmi.pyx":4604
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self, variable_name):
 */
  __pyx_k_tuple_261 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_83)); if (unlikely(!__pyx_k_tuple_261)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_261);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_261));

  /* "pyfmi\fmi.pyx":4647
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 *     def get_fmu_state(self, FMUState2 state = None):
 */
  __pyx_k_tuple_262 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_85)); if (unlikely(!__pyx_k_tuple_262)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_262);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_262));

  /* "pyfmi\fmi.pyx":4674
 * 
 *         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_265 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_264)); if (unlikely(!__pyx_k_tuple_265)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_265);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_265));

  /* "pyfmi\fmi.pyx":4679
 * 
 *         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_267 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_266)); if (unlikely(!__pyx_k_tuple_267)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_267);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_267));

  /* "pyfmi\fmi.pyx":4701
 * 
 *         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_269 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_268)); if (unlikely(!__pyx_k_tuple_269)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_269);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_269));

  /* "pyfmi\fmi.pyx":4706
 * 
 *         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_271 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_270)); if (unlikely(!__pyx_k_tuple_271)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_271);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_271));

  /* "pyfmi\fmi.pyx":4727
 * 
 *         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_272 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_264)); if (unlikely(!__pyx_k_tuple_272)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_272);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_272));

  /* "pyfmi\fmi.pyx":4735
 * 
 *         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_275 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_274)); if (unlikely(!__pyx_k_tuple_275)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_275);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_275));

  /* "pyfmi\fmi.pyx":4909
 *                 regexp.append(re.compile(regex))
 *         else:
 *             raise FMUException("Unknown input.")             # <<<<<<<<<<<<<<
 *         return regexp
 * 
 */
  __pyx_k_tuple_278 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_278)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_278);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_278));

  /* "pyfmi\fmi.pyx":4955
 *         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_280 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_279)); if (unlikely(!__pyx_k_tuple_280)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_280);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_280));

  /* "pyfmi\fmi.pyx":4979
 * 
 *         if start_indexp == NULL:
 *             raise FMUException("No dependency information for the outputs was found in the model description.")             # <<<<<<<<<<<<<<
 * 
 *         if python3_flag:
 */
  __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 = 4979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_283);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_283));

  /* "pyfmi\fmi.pyx":5025
 * 
 *         if start_indexp == NULL:
 *             raise FMUException("No dependency information for the derivatives was found in the model description.")             # <<<<<<<<<<<<<<
 * 
 *         if python3_flag:
 */
  __pyx_k_tuple_286 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_285)); if (unlikely(!__pyx_k_tuple_286)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_286);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_286));

  /* "pyfmi\fmi.pyx":5204
 * 
 *         if variable_list == NULL:
 *             raise FMUException("The returned derivatives states list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
  __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 = 5204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_296);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_296));

  /* "pyfmi\fmi.pyx":5254
 * 
 *         if variable_list == NULL:
 *             raise FMUException("The returned outputs list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
  __pyx_k_tuple_298 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_297)); if (unlikely(!__pyx_k_tuple_298)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_298);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_298));

  /* "pyfmi\fmi.pyx":5326
 * 
 *         if not self._provides_directional_derivatives():
 *             raise FMUException('This FMU does not provide directional derivatives')             # <<<<<<<<<<<<<<
 * 
 *         if len(var_ref) != len(v):
 */
  __pyx_k_tuple_301 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_300)); if (unlikely(!__pyx_k_tuple_301)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_301);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_301));

  /* "pyfmi\fmi.pyx":5329
 * 
 *         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_303 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_302)); if (unlikely(!__pyx_k_tuple_303)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_303);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_303));

  /* "pyfmi\fmi.pyx":5343
 * 
 *         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_305 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_304)); if (unlikely(!__pyx_k_tuple_305)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_305);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_305));

  /* "pyfmi\fmi.pyx":5495
 *         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_309 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_308)); if (unlikely(!__pyx_k_tuple_309)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_309);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_309));

  /* "pyfmi\fmi.pyx":5498
 * 
 *         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_312 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_311)); if (unlikely(!__pyx_k_tuple_312)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_312);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_312));

  /* "pyfmi\fmi.pyx":5610
 *         status = FMIL.fmi2_import_cancel_step(self._fmu)
 *         if status != 0:
 *             raise FMUException('An error occured while canceling the step')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_315 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_314)); if (unlikely(!__pyx_k_tuple_315)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_315);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_315));

  /* "pyfmi\fmi.pyx":5643
 * 
 *         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_316 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_111)); if (unlikely(!__pyx_k_tuple_316)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_316);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_316));

  /* "pyfmi\fmi.pyx":5645
 *             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_317 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_113)); if (unlikely(!__pyx_k_tuple_317)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_317);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_317));

  /* "pyfmi\fmi.pyx":5656
 *                 orders[i] = order
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_set_real_input_derivatives(self._fmu, <FMIL.fmi2_value_reference_t*> value_refs.data, nref,
 */
  __pyx_k_tuple_318 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_101)); if (unlikely(!__pyx_k_tuple_318)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_318);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_318));

  /* "pyfmi\fmi.pyx":5662
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     def get_output_derivatives(self, variables, FMIL.fmi2_integer_t order):
 */
  __pyx_k_tuple_319 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_116)); if (unlikely(!__pyx_k_tuple_319)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_319);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_319));

  /* "pyfmi\fmi.pyx":5708
 *                 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_320 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_101)); if (unlikely(!__pyx_k_tuple_320)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_320);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_320));

  /* "pyfmi\fmi.pyx":5716
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_321 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_103)); if (unlikely(!__pyx_k_tuple_321)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_321);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_321));

  /* "pyfmi\fmi.pyx":5751
 *             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_323 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_322)); if (unlikely(!__pyx_k_tuple_323)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_323);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_323));

  /* "pyfmi\fmi.pyx":5755
 *         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_325 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_324)); if (unlikely(!__pyx_k_tuple_325)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_325);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_325));

  /* "pyfmi\fmi.pyx":5783
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_326 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_322)); if (unlikely(!__pyx_k_tuple_326)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_326);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_326));

  /* "pyfmi\fmi.pyx":5788
 *         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_327 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_324)); if (unlikely(!__pyx_k_tuple_327)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_327);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_327));

  /* "pyfmi\fmi.pyx":5816
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_328 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_322)); if (unlikely(!__pyx_k_tuple_328)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_328);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_328));

  /* "pyfmi\fmi.pyx":5821
 *         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_329 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_324)); if (unlikely(!__pyx_k_tuple_329)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_329);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_329));

  /* "pyfmi\fmi.pyx":5849
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_330 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_322)); if (unlikely(!__pyx_k_tuple_330)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_330);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_330));

  /* "pyfmi\fmi.pyx":5854
 *         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_331 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_324)); if (unlikely(!__pyx_k_tuple_331)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_331);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_331));

  /* "pyfmi\fmi.pyx":5882
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_332 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_322)); if (unlikely(!__pyx_k_tuple_332)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_332);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_332));

  /* "pyfmi\fmi.pyx":5887
 *         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_333 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_324)); if (unlikely(!__pyx_k_tuple_333)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_333);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_333));

  /* "pyfmi\fmi.pyx":6064
 *         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_341 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_340)); if (unlikely(!__pyx_k_tuple_341)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_341);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_341));

  /* "pyfmi\fmi.pyx":6067
 * 
 *         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_342 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_311)); if (unlikely(!__pyx_k_tuple_342)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_342);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_342));

  /* "pyfmi\fmi.pyx":6128
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 *         self.__t = t
 * 
 */
  __pyx_k_tuple_343 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_146)); if (unlikely(!__pyx_k_tuple_343)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_343);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_343));

  /* "pyfmi\fmi.pyx":6186
 * 
 *         if status != 0:
 *             raise FMUException('Failed to enter event mode.')             # <<<<<<<<<<<<<<
 * 
 *     def enter_continuous_time_mode(self):
 */
  __pyx_k_tuple_349 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_348)); if (unlikely(!__pyx_k_tuple_349)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_349);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_349));

  /* "pyfmi\fmi.pyx":6197
 * 
 *         if status != 0:
 *             raise FMUException('Failed to enter continuous time mode.')             # <<<<<<<<<<<<<<
 * 
 *     def get_event_indicators(self):
 */
  __pyx_k_tuple_351 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_350)); if (unlikely(!__pyx_k_tuple_351)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_351);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_351));

  /* "pyfmi\fmi.pyx":6220
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_352 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_157)); if (unlikely(!__pyx_k_tuple_352)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_352);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_352));

  /* "pyfmi\fmi.pyx":6318
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         return enterEventMode==FMI2_TRUE, terminateSimulation==FMI2_TRUE
 */
  __pyx_k_tuple_356 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_166)); if (unlikely(!__pyx_k_tuple_356)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_356);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_356));

  /* "pyfmi\fmi.pyx":6335
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_357 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_148)); if (unlikely(!__pyx_k_tuple_357)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_357);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_357));

  /* "pyfmi\fmi.pyx":6352
 * 
 *         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_358 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_150)); if (unlikely(!__pyx_k_tuple_358)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_358);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_358));

  /* "pyfmi\fmi.pyx":6360
 * 
 *         if status >= 3:
 *             raise FMUException('Failed to set the new continuous states.')             # <<<<<<<<<<<<<<
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,
 */
  __pyx_k_tuple_359 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_152)); if (unlikely(!__pyx_k_tuple_359)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_359);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_359));

  /* "pyfmi\fmi.pyx":6383
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_360 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_154)); if (unlikely(!__pyx_k_tuple_360)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_360);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_360));

  /* "pyfmi\fmi.pyx":6586
 * 
 *     # 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_367 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_k_tuple_367)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_367);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_367));

  /* "pyfmi\fmi.pyx":6587
 *     # 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_368 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_22)); if (unlikely(!__pyx_k_tuple_368)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_368);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_368));

  /* "pyfmi\fmi.pyx":6619
 *             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_369 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_25)); if (unlikely(!__pyx_k_tuple_369)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_369);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_369));

  /* "pyfmi\fmi.pyx":6625
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Parse the XML
 */
  __pyx_k_tuple_371 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_370)); if (unlikely(!__pyx_k_tuple_371)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_371);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_371));

  /* "pyfmi\fmi.pyx":6634
 *             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_372 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_30)); if (unlikely(!__pyx_k_tuple_372)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_372);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_372));

  /* "pyfmi\fmi.pyx":6652
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Delete the XML
 */
  __pyx_k_tuple_373 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_370)); if (unlikely(!__pyx_k_tuple_373)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_373);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_373));

  /* "pyfmi\fmi.pyx":6674
 *             if line == "":
 *                 break
 *             log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(log)):
 */
  __pyx_k_tuple_374 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_40)); if (unlikely(!__pyx_k_tuple_374)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_374);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_374));

  /* "pyfmi\fmi.pyx":6669
 * def _handle_load_fmu_exception(fmu, log_file):
 *     log = []
 *     with open(log_file,'r') as file:             # <<<<<<<<<<<<<<
 *         while True:
 *             line = file.readline()
 */
  __pyx_k_tuple_375 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_375)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_375);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_375));

  /* "pyfmi\fmi.pyx":6741
 *     # 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_377 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_k_tuple_377)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_377);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_377));

  /* "pyfmi\fmi.pyx":6742
 *     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_378 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_22)); if (unlikely(!__pyx_k_tuple_378)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_378);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_378));

  /* "pyfmi\fmi.pyx":6746
 *     #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_379 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_186)); if (unlikely(!__pyx_k_tuple_379)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_379);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_379));

  /* "pyfmi\fmi.pyx":6774
 *             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_381 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_k_tuple_381)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_381);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_381));

  /* "pyfmi\fmi.pyx":6814
 *         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_383 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_25)); if (unlikely(!__pyx_k_tuple_383)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_383);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_383));

  /* "pyfmi\fmi.pyx":6826
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is unsupported. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_386 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_385)); if (unlikely(!__pyx_k_tuple_386)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_386);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_386));

  /* "pyfmi\fmi.pyx":6844
 *             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_387 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_193)); if (unlikely(!__pyx_k_tuple_387)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_387);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_387));

  /* "pyfmi\fmi.pyx":6858
 *             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_389 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_388)); if (unlikely(!__pyx_k_tuple_389)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_389);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_389));

  /* "pyfmi\fmi.pyx":6880
 *             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_392 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_193)); if (unlikely(!__pyx_k_tuple_392)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_392);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_392));

  /* "pyfmi\fmi.pyx":6895
 *             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_393 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_196)); if (unlikely(!__pyx_k_tuple_393)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_393);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_393));

  /* "pyfmi\fmi.pyx":6930
 *         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_396 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_395)); if (unlikely(!__pyx_k_tuple_396)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_396);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_396));

  /* "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_398 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_397)); if (unlikely(!__pyx_k_tuple_398)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_398);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_398));

  /* "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_400 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_399)); if (unlikely(!__pyx_k_tuple_400)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_400);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_400));

  /* "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_402 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_401)); if (unlikely(!__pyx_k_tuple_402)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_402);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_402));

  /* "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_405 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_404)); if (unlikely(!__pyx_k_tuple_405)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_405);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_405));

  /* "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_406 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_401)); if (unlikely(!__pyx_k_tuple_406)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_406);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_406));

  /* "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_408 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_407)); if (unlikely(!__pyx_k_tuple_408)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_408);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_408));

  /* "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_415 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__x)); if (unlikely(!__pyx_k_tuple_415)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_415);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_415));
  __pyx_k_codeobj_416 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_415, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_417, __pyx_n_s__encode, 44, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_416)) {__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_419 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__x)); if (unlikely(!__pyx_k_tuple_419)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_419);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_419));
  __pyx_k_codeobj_420 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_419, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_417, __pyx_n_s__decode, 46, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_420)) {__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_421 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__x)); if (unlikely(!__pyx_k_tuple_421)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_421);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_421));
  __pyx_k_codeobj_422 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_421, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_417, __pyx_n_s__encode, 49, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_422)) {__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_423 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__x)); if (unlikely(!__pyx_k_tuple_423)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_423);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_423));
  __pyx_k_codeobj_424 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_423, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_417, __pyx_n_s__decode, 51, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_424)) {__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_429 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_428)); if (unlikely(!__pyx_k_tuple_429)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_429);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_429));

  /* "pyfmi\fmi.pyx":6562
 *         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_446 = 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_446)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_446);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_446));
  __pyx_k_codeobj_447 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_446, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_417, __pyx_n_s__load_fmu_deprecated, 6562, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_447)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":6667
 *     return model
 * 
 * def _handle_load_fmu_exception(fmu, log_file):             # <<<<<<<<<<<<<<
 *     log = []
 *     with open(log_file,'r') as file:
 */
  __pyx_k_tuple_448 = 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_448)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_448);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_448));
  __pyx_k_codeobj_449 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_448, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_417, __pyx_n_s_382, 6667, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_449)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":6679
 *         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_451 = 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_450)); if (unlikely(!__pyx_k_tuple_451)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_451);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_451));
  __pyx_k_codeobj_452 = (PyObject*)__Pyx_PyCode_New(6, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_451, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_417, __pyx_n_s__load_fmu, 6679, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_452)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6679; __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_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__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_409), 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 ---*/
  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_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 = 353; __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 = 353; __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 = 452; __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 = 452; __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 = 566; __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 = 566; __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._logger = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, jm_string, int, jm_string))__pyx_f_5pyfmi_3fmi_12FMUModelBase__logger;
  __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 = 575; __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 = 575; __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 = 575; __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 = 575; __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 = 2073; __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 = 2073; __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 = 2073; __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 = 2517; __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 = 2517; __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 = 2517; __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._logger = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, jm_string, int, jm_string))__pyx_f_5pyfmi_3fmi_13FMUModelBase2__logger;
  __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_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 = 3081; __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 = 3081; __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 = 3081; __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 = 3081; __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_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 = 5460; __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 = 5460; __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 = 5460; __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 = 5460; __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 = 6029; __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 = 6029; __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 = 6029; __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 = 6029; __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 = 6557; __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 = 6557; __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 = 6557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModel = &__pyx_type_5pyfmi_3fmi_FMUModel;
  /*--- 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_411));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s_411));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_411));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_410), ((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_412), ((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_412), ((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_413), ((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_414), ((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_418); 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_418); 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_418); 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_418); 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_425)) < 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_426)) < 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_427, __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_429), 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_130, __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_33, __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_430, __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_431, __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_432, __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":343
 *         return algorithm.get_default_options()
 * 
 * class FMUException(Exception):             # <<<<<<<<<<<<<<
 *     """
 *     An FMU exception.
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __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 = 343; __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_433)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __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_418); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __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 = 343; __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":349
 *     pass
 * 
 * class PyEventInfo():             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __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_418); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __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 = 349; __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":358
 *     """
 *     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 = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_8 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":359
 *     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 = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_9 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":360
 *                        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 = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_10 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":379
 *         """
 *         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 = 379; __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 = 379; __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 = 379; __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 = 379; __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":390
 *         """
 *         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_434); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __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 = 390; __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 = 390; __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 = 390; __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":402
 *         """
 *         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 = 402; __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 = 402; __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 = 402; __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 = 402; __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":414
 *         """
 *         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 = 414; __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 = 414; __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 = 414; __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 = 414; __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":426
 *         """
 *         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 = 426; __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 = 426; __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 = 426; __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 = 426; __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":438
 *         """
 *         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 = 438; __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 = 438; __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 = 438; __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 = 438; __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":450
 *         """
 *         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 = 450; __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 = 450; __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 = 450; __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 = 450; __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":457
 *     """
 *     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 = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_11 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":458
 *     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 = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_12 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":459
 *                        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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_13 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":460
 *                        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 = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_14 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":480
 *         """
 *         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 = 480; __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 = 480; __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 = 480; __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 = 480; __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":491
 *         """
 *         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_434); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __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 = 491; __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 = 491; __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 = 491; __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":503
 *         """
 *         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 = 503; __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 = 503; __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 = 503; __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 = 503; __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":515
 *         """
 *         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 = 515; __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 = 515; __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 = 515; __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 = 515; __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":527
 *         """
 *         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 = 527; __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 = 527; __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 = 527; __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 = 527; __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":539
 *         """
 *         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 = 539; __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 = 539; __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 = 539; __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 = 539; __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":551
 *         """
 *         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 = 551; __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 = 551; __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 = 551; __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 = 551; __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":564
 *         """
 *         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 = 564; __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 = 564; __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 = 564; __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 = 564; __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":579
 *     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_430); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_16 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":793
 *         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 = 793; __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 = 793; __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 = 793; __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 = 793; __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 = 793; __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":1555
 * 
 * 
 *     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 = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k_87 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":1557
 *     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 = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k_88 = __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 = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k_89 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":1988
 *                  input=(),
 *                  algorithm='SciEstAlg',
 *                  options={}):             # <<<<<<<<<<<<<<
 *         """
 *         Compact function for model estimation.
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_k_93 = ((PyObject *)__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2077
 *     #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_430); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k_96 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2092
 *         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 = 2092; __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 = 2092; __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 = 2092; __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 = 2092; __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_435)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; __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 = 2092; __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 = 2092; __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":2124
 *             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 = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k_99 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2237
 *         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 = 2237; __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 = 2237; __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 = 2237; __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 = 2237; __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 = 2237; __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":2314
 *                  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 = 2314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_k_118 = ((PyObject *)__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2403
 *         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 = 2403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_122 = __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 = 2403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_123 = __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 = 2403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_124 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2446
 * 
 * 
 *     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 = 2446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_129 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2522
 *     """
 * 
 *     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_430); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_141 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2547
 *         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 = 2547; __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_436); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2547; __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 = 2547; __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 = 2547; __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_437, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2547; __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":2618
 *             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 = 2618; __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 = 2618; __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 = 2618; __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 = 2618; __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_435)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2618; __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 = 2618; __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 = 2618; __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":2649
 *             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_438); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2649; __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_439); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2649; __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 = 2649; __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 = 2649; __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_440)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2649; __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 = 2649; __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 = 2649; __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":2668
 *         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_441); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2668; __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 = 2668; __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 = 2668; __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_442)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2668; __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 = 2668; __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_160, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2668; __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":2751
 *         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 = 2751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_161 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2879
 * 
 * 
 *     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 = 2879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_168 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2937
 * 
 * 
 *     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 = 2937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_177 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2979
 *                  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 = 2979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_k_181 = ((PyObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3085
 *     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_430); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_182 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3656
 * 
 * 
 *     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 = 3656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_217 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3695
 *             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 = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_221 = __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 = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_222 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3870
 *             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 = 3870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_250 = ((PyObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4160
 * 
 * 
 *     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 = 4160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_256 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4162
 *     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 = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_257 = __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 = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_258 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5056
 *         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 = 5056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_288 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5167
 * 
 * 
 *     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 = 5167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_291 = __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 = 5167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_292 = __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 = 5167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_293 = __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 = 5167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_294 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5464
 *     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 = 5464; __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_GetName(__pyx_m, __pyx_n_s_430); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5464; __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":5548
 *         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 = 5548; __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 = 5548; __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 = 5548; __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 = 5548; __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_443)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5548; __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 = 5548; __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 = 5548; __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":5554
 *     """)
 * 
 *     def 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 = 5554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_313 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5897
 *                  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 = 5897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_k_334 = ((PyObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":6034
 *     """
 * 
 *     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 = 6034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_338 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_430); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_339 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":6131
 *         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 = 6131; __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 = 6131; __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 = 6131; __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 = 6131; __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_435)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6131; __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 = 6131; __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 = 6131; __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":6224
 *         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 = 6224; __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":6297
 *         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 = 6297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_355 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":6362
 *             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_438); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6362; __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_439); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6362; __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 = 6362; __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 = 6362; __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_444)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6362; __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 = 6362; __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 = 6362; __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":6387
 *         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_441); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6387; __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 = 6387; __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 = 6387; __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_445)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6387; __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 = 6387; __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_160, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6387; __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":6424
 *                  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 = 6424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_k_361 = ((PyObject *)__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6558
 * #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 = 6558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_364 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6562
 *         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 = 6562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_366 = __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_418); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6562; __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 = 6562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6667
 *     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_418); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_382, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6679
 *         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_430); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_376 = __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_418); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6679; __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 = 6679; __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 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 int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->tp_traverse(obj, v, a);
    return 0;
}

static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

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