/* Generated by Cython 0.16 on Fri Jan 31 16:48:13 2014 */

#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 CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyCFunction_Call PyObject_Call
#else
  #define __Pyx_PyCFunction_Call PyCFunction_Call
#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 PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
#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_GET_LENGTH)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#else
  #define CYTHON_PEP393_ENABLED 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]))
#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 "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


/* inline attribute */
#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

/* unused attribute */
#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*/


/* Type Conversion Predeclarations */

#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*);

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#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",
};
#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 */
  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":722
 * # 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":723
 * 
 * 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":724
 * 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":725
 * 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":729
 * #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":730
 * 
 * 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":731
 * 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":732
 * 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":736
 * #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":737
 * 
 * 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":746
 * # 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":747
 * # 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":748
 * 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":750
 * 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":751
 * 
 * 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":752
 * 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":754
 * 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":755
 * 
 * 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":757
 * 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":758
 * 
 * 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":759
 * 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":761
 * 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":762
 * 
 * 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":763
 * 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":765
 * 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":130
 *     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_temp_dir;
  PyObject *_fmu_full_path;
  PyObject *_enable_logging;
  PyObject *_allocated_context;
  PyObject *_allocated_xml;
  PyObject *_allocated_dll;
  PyObject *_allocated_fmu;
  char *_modelId;
  PyObject *_modelName;
  PyObject *_fmu_log_name;
  PyObject *_categories;
  PyObject *_save_real_variables_val;
  PyObject *_save_int_variables_val;
  PyObject *_save_bool_variables_val;
  PyObject *__pyx___t;
  PyObject *_pyEventInfo;
};


/* "pyfmi\fmi.pxd":181
 *     cdef _add_scalar_variables(self, FMIL.fmi2_import_variable_list_t*   variable_list)
 * 
 * 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":72
 * 
 * 
 * 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":119
 *     cpdef FMIL.fmi1_causality_enu_t get_variable_causality(self, char* 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":64
 *     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":186
 *     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":124
 *     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;
  PyObject *_name;
  PyObject *_description;
};


/* "pyfmi\fmi.pyx":5933
 * 
 * #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":490
 * 
 * 
 * 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 *, char *, int __pyx_skip_dispatch);
  enum fmi1_base_type_enu_t (*get_variable_data_type)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch);
  fmi1_value_reference_t (*get_variable_valueref)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_fixed)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_start)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_max)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_min)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch);
  enum fmi1_variability_enu_t (*get_variable_variability)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch);
  enum fmi1_causality_enu_t (*get_variable_causality)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase;


/* "pyfmi\fmi.pyx":2272
 *         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":5933
 * 
 * #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":2835
 * 
 * 
 * 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 *, char *, int __pyx_skip_dispatch);
  fmi2_base_type_enu_t (*get_variable_data_type)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, char *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_description)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, char *, int __pyx_skip_dispatch);
  fmi2_variability_enu_t (*get_variable_variability)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, char *, int __pyx_skip_dispatch);
  fmi2_causality_enu_t (*get_variable_causality)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, char *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_start)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, char *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_max)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, char *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_min)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, char *, 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 *);
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2;


/* "pyfmi\fmi.pyx":5352
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 * 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 *(*completed_event_iteration)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *, 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":1846
 * 
 * 
 * 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":4740
 * 
 * 
 * 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 int __Pyx_GetException(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 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_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 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 (likely(o != Py_None)) {
        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));
}
#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 (likely(o != Py_None)) {
        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));
}
#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 (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 if (likely(i >= 0)) {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            return m->sq_item(o, i);
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

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

#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 (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 if (likely(i >= 0)) {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            return m->sq_ass_item(o, i, v);
        }
    }
    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);

static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);

#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(d == Py_None)) {
        __Pyx_RaiseNoneIndexingError();
        return NULL;
    }
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred())
            PyErr_SetObject(PyExc_KeyError, key);
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long 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 *modname); /*proto*/

static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
#if 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_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/

static CYTHON_INLINE fmi1_value_reference_t __Pyx_PyInt_from_py_fmi1_value_reference_t(PyObject *);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_value_reference_t(fmi1_value_reference_t);

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/

#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

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 PyObject *__Pyx_PyInt_to_py_fmi2_boolean_t(fmi2_boolean_t);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi2_integer_t(fmi2_integer_t);

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

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

static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

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

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

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

static CYTHON_INLINE 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_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 PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/

static PyObject *__Pyx_ImportModule(const char *name); /*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.stdio' */

/* Module declarations from 'cpython.object' */

/* 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, 'U', 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, '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, 'U', 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, '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_sorted;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
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_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); /* 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 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_2get_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_4_internal_set_fmu_null(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_6print_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_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_10_get_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12get_ode_sizes(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_14get_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_16set_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_18get_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_20set_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_22get_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24set_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_26get_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_28set_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_30set_debug_logging(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_32set_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_34set_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_36_set(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variable_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_38_get(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_40get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_42get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_44get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_46get_variable_nominal(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variablename, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_50get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_56get_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_58get_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_60get_variable_alias_base(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_62get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_64get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_66get_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_68get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_70get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_72get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_74get_author(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_76get_default_experiment_start_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_78get_default_experiment_stop_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_80get_default_experiment_tolerance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_82get_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_84get_generation_tool(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_86get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_11FMUModelCS1___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_2_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_4_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_t); /* proto */
static void __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_6__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_8do_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_current_t, fmi1_real_t __pyx_v_step_size, PyObject *__pyx_v_new_step); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_10cancel_step(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_variables, fmi1_integer_t __pyx_v_order); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_14_get_types_platform(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_16set_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_18simulate(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_20simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_22initialize(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_24reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_26instantiate_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_28get_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); /* 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, char *__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, char *__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_26set_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_28get_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_30set_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_32get_categories(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_34get_variable_nominal(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variablename, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_36get_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_38get_variable_alias_base(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_40get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_42get_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_44get_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_46get_variable_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_48get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_50get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_52get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_54get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_56get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_58get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_60get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_62get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_64get_fmu_state(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_66set_fmu_state(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_68free_fmu_state(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_70serialize_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_72deserialize_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_serialized_fmu); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_74serialized_fmu_state_size(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_76get_ode_sizes(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_78get_default_experiment_start_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_80get_default_experiment_stop_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_82get_default_experiment_tolerance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_84_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_86get_derivatives_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_88get_states_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_90get_input_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_92get_output_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_94get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_96get_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_98get_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_100get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_102get_author(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_104get_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_106get_generation_tool(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_108get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_110get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_112get_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_13_fmu_log_name___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name_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 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); /* 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_4instantiate_slave(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_visible); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_6initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_tStart, PyObject *__pyx_v_tStop, PyObject *__pyx_v_StopTimeDefined, PyObject *__pyx_v_relTol); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_8reset_slave(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_10_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_12_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_14do_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_16cancel_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_18set_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_20get_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_22get_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_24get_real_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_26get_integer_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_28get_boolean_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_30get_string_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_32simulate(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_34simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_algorithm); /* 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); /* 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_4instantiate_model(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_visible); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_6initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_tolControlled, PyObject *__pyx_v_relativeTolerance); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_8reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_10terminate(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_12_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_14_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_16get_event_info(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_18get_event_indicators(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_20event_update(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_intermediateResult); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_22get_tolerances(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_24completed_event_iteration(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_26completed_integrator_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_28_get_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_30_set_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_32_get_nominal_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_34get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_36simulate(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_38simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_algorithm); /* 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_load_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_2_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_4load_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 level = %d: %s\n";
static char __pyx_k_3[] = "FMU: fmiStatus = %d;  %s (%s): %s\n";
static char __pyx_k_4[] = "common.algorithm_drivers";
static char __pyx_k_5[] = " must be a subclass of common.algorithm_drivers.AlgorithmBase";
static char __pyx_k_6[] = "";
static char __pyx_k_13[] = ".";
static char __pyx_k_15[] = "The log level must be between %d and %d";
static char __pyx_k_16[] = "The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...";
static char __pyx_k_18[] = ".fmu";
static char __pyx_k_20[] = "FMUModel must be instantiated with an FMU (.fmu) file.";
static char __pyx_k_22[] = "The FMU version could not be determined. ";
static char __pyx_k_23[] = "The FMU version could not be determined. Enable logging for possibly more information.";
static char __pyx_k_25[] = "This class only supports FMI 1.0 (Model Exchange and Co-Simulation).";
static char __pyx_k_27[] = "The XML file could not be parsed. ";
static char __pyx_k_28[] = "The XML file could not be parsed. Enable logging for possibly more information.";
static char __pyx_k_31[] = "FMI_REGISTER_GLOBALLY";
static char __pyx_k_32[] = "Error loading the binary. Enable logging for possibly more information.";
static char __pyx_k_34[] = "_log.txt";
static char __pyx_k_37[] = "\n";
static char __pyx_k_40[] = "_internal_set_fmu_null";
static char __pyx_k_41[] = "Unknown input.";
static char __pyx_k_43[] = "Failed to get the Real values.";
static char __pyx_k_45[] = "The length of valueref and values are inconsistent.";
static char __pyx_k_47[] = "Failed to set the Real values.";
static char __pyx_k_49[] = "Failed to get the Integer values.";
static char __pyx_k_52[] = "Failed to set the Integer values.";
static char __pyx_k_54[] = "Failed to get the Boolean values.";
static char __pyx_k_57[] = "Failed to set the Boolean values.";
static char __pyx_k_59[] = "Failed to set the debugging option.";
static char __pyx_k_61[] = "Invalid log level for FMI Library (0-7).";
static char __pyx_k_63[] = "The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.";
static char __pyx_k_65[] = "The variable %s could not be found.";
static char __pyx_k_66[] = "Type not supported.";
static char __pyx_k_69[] = "get_variable_description";
static char __pyx_k_70[] = "get_variable_data_type";
static char __pyx_k_71[] = "get_variable_valueref";
static char __pyx_k_72[] = "The variable with value reference: %s, could not be found.";
static char __pyx_k_73[] = "Either provide value reference or variable name.";
static char __pyx_k_75[] = "The variable is not a real variable.";
static char __pyx_k_77[] = "The variable %s does not have a start value.";
static char __pyx_k_78[] = "Unknown variable type.";
static char __pyx_k_80[] = "The variable type does not have a maximum value.";
static char __pyx_k_82[] = "The variable type does not have a minimum value.";
static char __pyx_k_87[] = "get_variable_variability";
static char __pyx_k_88[] = "The variable with the valuref %i could not be found.";
static char __pyx_k_89[] = "get_variable_causality";
static char __pyx_k_91[] = "This class only supports FMI 1.0 for Co-simulation.";
static char __pyx_k_94[] = "The order must be greater than zero and below the maximum output derivative support of the FMU (%d).";
static char __pyx_k_95[] = "The variables must either be a string or a list of strings";
static char __pyx_k_97[] = "Failed to get the Real output derivatives.";
static char __pyx_k_99[] = "The number of variables must be the same as the number of orders.";
static char __pyx_k__B[] = "B";
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_101[] = "The order must be greater than zero.";
static char __pyx_k_103[] = "The FMU does not support input derivatives.";
static char __pyx_k_106[] = "Failed to set the Real input derivatives.";
static char __pyx_k_109[] = "get_default_experiment_start_time";
static char __pyx_k_110[] = "get_default_experiment_stop_time";
static char __pyx_k_111[] = "_exec_simulate_algorithm";
static char __pyx_k_112[] = "pyfmi.fmi_algorithm_drivers";
static char __pyx_k_116[] = "The slave failed to initialize. See the log for possibly more information.";
static char __pyx_k_118[] = "Failed to reset the FMU.";
static char __pyx_k_121[] = "FMI_MIME_CS_STANDALONE";
static char __pyx_k_122[] = "Failed to instantiate the slave. See the log for possibly more information.";
static char __pyx_k_124[] = "Failed to set the debugging option. See the log for possibly more information.";
static char __pyx_k_126[] = "canHandleVariableCommunicationStepSize";
static char __pyx_k_127[] = "canInterpolateInputs";
static char __pyx_k_128[] = "maxOutputDerivativeOrder";
static char __pyx_k_129[] = "canRunAsynchronuously";
static char __pyx_k_130[] = "canBeInstantiatedOnlyOncePerProcess";
static char __pyx_k_131[] = "canNotUseMemoryManagementFunctions";
static char __pyx_k_133[] = "This class only supports FMI 1.0 for Model Exchange.";
static char __pyx_k_135[] = "The DLL could not be reloaded, check the log for more information.";
static char __pyx_k_137[] = "Failed to set the time.";
static char __pyx_k_139[] = "Failed to retrieve the continuous states.";
static char __pyx_k_141[] = "Failed to set the new continuous states. The number of values are not consistent with the number of continuous states.";
static char __pyx_k_143[] = "Failed to set the new continuous states.";
static char __pyx_k_145[] = "Failed to get the nominal values.";
static char __pyx_k_147[] = "Failed to get the derivative values.";
static char __pyx_k_149[] = "Failed to get the event indicators.";
static char __pyx_k_151[] = "get_default_experiment_tolerance";
static char __pyx_k_152[] = "nominal_continuous_states";
static char __pyx_k_154[] = "Failed to update the events.";
static char __pyx_k_156[] = "stateValueReferencesChanged";
static char __pyx_k_157[] = "Failed to get the continuous state reference values.";
static char __pyx_k_159[] = "Failed to call FMI Completed Step.";
static char __pyx_k_162[] = "Initialize returned with a warning. Check the log for information (FMUModel.get_log).";
static char __pyx_k_164[] = "Initialize returned with a warning. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_166[] = "Initialize returned with a error. Check the log for information (FMUModel.get_log).";
static char __pyx_k_168[] = "Initialize returned with a error. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_171[] = "Failed to instantiate the model. See the log for possibly more information.";
static char __pyx_k_178[] = "Could not locate the FMU in the specified directory.";
static char __pyx_k_181[] = "The FMU version is not supported by this class. ";
static char __pyx_k_182[] = "The FMU version is not supported by this class. Enable logging for possibly more information.";
static char __pyx_k_184[] = "The XML-could not be read. ";
static char __pyx_k_185[] = "The XML-could not be read. Enable logging for possible nore information.";
static char __pyx_k_187[] = "The FMU kind could not be determined. ";
static char __pyx_k_188[] = "The FMU kind could not be determined. Enable logging for possibly more information.";
static char __pyx_k_207[] = "Logging is not enabled";
static char __pyx_k_210[] = "Currently the logging of categories is not availible. See the docstring for more information";
static char __pyx_k_221[] = "deserialize_fmu_state";
static char __pyx_k_222[] = "serialized_fmu_state_size";
static char __pyx_k_224[] = "The returned states list is NULL.";
static char __pyx_k_227[] = "The returned input list is NULL.";
static char __pyx_k_230[] = "me_needsExecutionTool";
static char __pyx_k_231[] = "me_completedIntegratorStepNotNeeded";
static char __pyx_k_232[] = "me_canBeInstantiatedOnlyOncePerProcess";
static char __pyx_k_233[] = "me_canNotUseMemoryManagementFunctions";
static char __pyx_k_234[] = "me_canGetAndSetFMUstate";
static char __pyx_k_235[] = "me_canSerializeFMUstate";
static char __pyx_k_236[] = "me_providesDirectionalDerivatives";
static char __pyx_k_237[] = "me_completedEventIterationIsProvided";
static char __pyx_k_238[] = "cs_needsExecutionTool";
static char __pyx_k_239[] = "cs_canHandleVariableCommunicationStepSize";
static char __pyx_k_240[] = "cs_canInterpolateInputs";
static char __pyx_k_241[] = "cs_maxOutputDerivativeOrder";
static char __pyx_k_242[] = "cs_canRunAsynchronuously";
static char __pyx_k_243[] = "cs_canBeInstantiatedOnlyOncePerProcess";
static char __pyx_k_244[] = "cs_canNotUseMemoryManagementFunctions";
static char __pyx_k_245[] = "cs_canGetAndSetFMUstate";
static char __pyx_k_246[] = "cs_canSerializeFMUstate";
static char __pyx_k_247[] = "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_249[] = "This FMU does not provide directional derivatives";
static char __pyx_k_251[] = "The length of the list with variables (var_ref) and the seed vector (V) are not equal";
static char __pyx_k_253[] = "An error occured while getting the directional derivative, see the log for possible more information";
static char __pyx_k_257[] = "get_capability_flags";
static char __pyx_k_258[] = "Models that need an execution tool are not supported";
static char __pyx_k_261[] = "Failed to instantiate the slave.";
static char __pyx_k_266[] = "The slave failed to initialize.";
static char __pyx_k_268[] = "An error occured when reseting the slave, see the log for possible more information";
static char __pyx_k_271[] = "An error occured while canceling the step";
static char __pyx_k_279[] = "Status kind has to be between 0 and 3";
static char __pyx_k_281[] = "An error occured while retriving the status";
static char __pyx_k_295[] = "This class only supports FMI 2.0 for Model Exchange.";
static char __pyx_k_299[] = "Failed to instantiate the model.";
static char __pyx_k_311[] = "completed_event_iteration";
static char __pyx_k_312[] = "An error occured when updating FMU after global event iteration has converged ";
static char __pyx_k_324[] = "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_329[] = "PyFMI currently only supports FMI 1.0.";
static char __pyx_k_339[] = "Input-argument \"kind\" can only be \"ME\", \"CS\" or \"auto\" (default) and not: ";
static char __pyx_k_341[] = "_handle_load_fmu_exception";
static char __pyx_k_343[] = "The FMU version is unsupported. ";
static char __pyx_k_344[] = "The FMU version is unsupported. Enable logging for possibly more information.";
static char __pyx_k_347[] = "PyFMI does not support co-simulation tool";
static char __pyx_k_349[] = "FMU is a ";
static char __pyx_k_350[] = " and not a ";
static char __pyx_k_353[] = "The FMU version is not found. ";
static char __pyx_k_354[] = "The FMU version is not found. Enable logging for possibly more information.";
static char __pyx_k_356[] = "ndarray is not C contiguous";
static char __pyx_k_358[] = "ndarray is not Fortran contiguous";
static char __pyx_k_360[] = "Non-native byte order not supported";
static char __pyx_k_362[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_363[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_366[] = "Format string allocated too short.";
static char __pyx_k_368[] = "\nModule containing the FMI interface Python wrappers.\n";
static char __pyx_k_369[] = "pyfmi.common.core";
static char __pyx_k_370[] = "\001";
static char __pyx_k_371[] = "\000";
static char __pyx_k_372[] = "application/x-fmu-sharedlibrary";
static char __pyx_k_373[] = "FMI_DEFAULT_LOG_LEVEL";
static char __pyx_k_374[] = "\n    An FMU exception.\n    ";
static char __pyx_k_375[] = "pyfmi.fmi";
static char __pyx_k_376[] = "_get_value_reference";
static char __pyx_k_377[] = "\n    Property for accessing the current time of the simulation. Calls the\n    low-level FMI function: fmiSetTime.\n    ";
static char __pyx_k_378[] = "_get_model_types_platform";
static char __pyx_k_379[] = "model_types_platform";
static char __pyx_k_380[] = "_get_continuous_states";
static char __pyx_k_381[] = "_set_continuous_states";
static char __pyx_k_382[] = "\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_383[] = "_get_nominal_continuous_states";
static char __pyx_k_384[] = "\n    Property for accessing the nominal values of the continuous states. Calls\n    the low-level FMI function: fmiGetNominalContinuousStates.\n    ";
static char __pyx_k_387[] = "C:\\Development\\PyFMI\\branches\\PyFMI-1.4.x\\src\\pyfmi\\fmi.pyx";
static char __pyx_k_390[] = "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__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__join[] = "join";
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__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__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__double[] = "double";
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__relTol[] = "relTol";
static char __pyx_k__sorted[] = "sorted";
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__logging[] = "logging";
static char __pyx_k__options[] = "options";
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__algdrive[] = "algdrive";
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__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____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__translate[] = "translate";
static char __pyx_k__variables[] = "variables";
static char __pyx_k__FMI2_FIXED[] = "FMI2_FIXED";
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__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__set_string[] = "set_string";
static char __pyx_k__start_time[] = "start_time";
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__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_version[] = "_get_version";
static char __pyx_k__fmu_temp_dir[] = "fmu_temp_dir";
static char __pyx_k__variablename[] = "variablename";
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__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__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__capabilities_Num[] = "capabilities_Num";
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__upcomingTimeEvent[] = "upcomingTimeEvent";
static char __pyx_k__cs_canHandleEvents[] = "cs_canHandleEvents";
static char __pyx_k__cs_canSignalEvents[] = "cs_canSignalEvents";
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__stateValuesChanged[] = "stateValuesChanged";
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_101;
static PyObject *__pyx_kp_s_103;
static PyObject *__pyx_kp_s_106;
static PyObject *__pyx_n_s_109;
static PyObject *__pyx_n_s_110;
static PyObject *__pyx_n_s_111;
static PyObject *__pyx_kp_s_112;
static PyObject *__pyx_kp_s_116;
static PyObject *__pyx_kp_s_118;
static PyObject *__pyx_n_s_121;
static PyObject *__pyx_kp_s_122;
static PyObject *__pyx_kp_s_124;
static PyObject *__pyx_n_s_126;
static PyObject *__pyx_n_s_127;
static PyObject *__pyx_n_s_128;
static PyObject *__pyx_n_s_129;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_n_s_130;
static PyObject *__pyx_n_s_131;
static PyObject *__pyx_kp_s_133;
static PyObject *__pyx_kp_s_135;
static PyObject *__pyx_kp_s_137;
static PyObject *__pyx_kp_s_139;
static PyObject *__pyx_kp_s_141;
static PyObject *__pyx_kp_s_143;
static PyObject *__pyx_kp_s_145;
static PyObject *__pyx_kp_s_147;
static PyObject *__pyx_kp_s_149;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_n_s_151;
static PyObject *__pyx_n_s_152;
static PyObject *__pyx_kp_s_154;
static PyObject *__pyx_n_s_156;
static PyObject *__pyx_kp_s_157;
static PyObject *__pyx_kp_s_159;
static PyObject *__pyx_kp_s_16;
static PyObject *__pyx_kp_s_162;
static PyObject *__pyx_kp_s_164;
static PyObject *__pyx_kp_s_166;
static PyObject *__pyx_kp_s_168;
static PyObject *__pyx_kp_s_171;
static PyObject *__pyx_kp_s_178;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_181;
static PyObject *__pyx_kp_s_182;
static PyObject *__pyx_kp_s_184;
static PyObject *__pyx_kp_s_185;
static PyObject *__pyx_kp_s_187;
static PyObject *__pyx_kp_s_188;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_207;
static PyObject *__pyx_kp_s_210;
static PyObject *__pyx_kp_s_22;
static PyObject *__pyx_n_s_221;
static PyObject *__pyx_n_s_222;
static PyObject *__pyx_kp_s_224;
static PyObject *__pyx_kp_s_227;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_n_s_230;
static PyObject *__pyx_n_s_231;
static PyObject *__pyx_n_s_232;
static PyObject *__pyx_n_s_233;
static PyObject *__pyx_n_s_234;
static PyObject *__pyx_n_s_235;
static PyObject *__pyx_n_s_236;
static PyObject *__pyx_n_s_237;
static PyObject *__pyx_n_s_238;
static PyObject *__pyx_n_s_239;
static PyObject *__pyx_n_s_240;
static PyObject *__pyx_n_s_241;
static PyObject *__pyx_n_s_242;
static PyObject *__pyx_n_s_243;
static PyObject *__pyx_n_s_244;
static PyObject *__pyx_n_s_245;
static PyObject *__pyx_n_s_246;
static PyObject *__pyx_kp_s_247;
static PyObject *__pyx_kp_s_249;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_251;
static PyObject *__pyx_kp_s_253;
static PyObject *__pyx_n_s_257;
static PyObject *__pyx_kp_s_258;
static PyObject *__pyx_kp_s_261;
static PyObject *__pyx_kp_s_266;
static PyObject *__pyx_kp_s_268;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_271;
static PyObject *__pyx_kp_s_279;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_281;
static PyObject *__pyx_kp_s_295;
static PyObject *__pyx_kp_s_299;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_n_s_31;
static PyObject *__pyx_n_s_311;
static PyObject *__pyx_kp_s_312;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_kp_s_324;
static PyObject *__pyx_kp_s_329;
static PyObject *__pyx_kp_s_339;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_n_s_341;
static PyObject *__pyx_kp_s_343;
static PyObject *__pyx_kp_s_344;
static PyObject *__pyx_kp_s_347;
static PyObject *__pyx_kp_s_349;
static PyObject *__pyx_kp_s_350;
static PyObject *__pyx_kp_s_353;
static PyObject *__pyx_kp_s_354;
static PyObject *__pyx_kp_u_356;
static PyObject *__pyx_kp_u_358;
static PyObject *__pyx_kp_u_360;
static PyObject *__pyx_kp_u_362;
static PyObject *__pyx_kp_u_363;
static PyObject *__pyx_kp_u_366;
static PyObject *__pyx_n_s_369;
static PyObject *__pyx_kp_s_37;
static PyObject *__pyx_kp_s_370;
static PyObject *__pyx_kp_s_371;
static PyObject *__pyx_kp_s_372;
static PyObject *__pyx_n_s_373;
static PyObject *__pyx_kp_s_374;
static PyObject *__pyx_n_s_375;
static PyObject *__pyx_n_s_376;
static PyObject *__pyx_kp_s_377;
static PyObject *__pyx_n_s_378;
static PyObject *__pyx_n_s_379;
static PyObject *__pyx_n_s_380;
static PyObject *__pyx_n_s_381;
static PyObject *__pyx_kp_s_382;
static PyObject *__pyx_n_s_383;
static PyObject *__pyx_kp_s_384;
static PyObject *__pyx_kp_s_387;
static PyObject *__pyx_n_s_390;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_n_s_40;
static PyObject *__pyx_kp_s_41;
static PyObject *__pyx_kp_s_43;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_kp_s_47;
static PyObject *__pyx_kp_s_49;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_52;
static PyObject *__pyx_kp_s_54;
static PyObject *__pyx_kp_s_57;
static PyObject *__pyx_kp_s_59;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_61;
static PyObject *__pyx_kp_s_63;
static PyObject *__pyx_kp_s_65;
static PyObject *__pyx_kp_s_66;
static PyObject *__pyx_n_s_69;
static PyObject *__pyx_n_s_70;
static PyObject *__pyx_n_s_71;
static PyObject *__pyx_kp_s_72;
static PyObject *__pyx_kp_s_73;
static PyObject *__pyx_kp_s_75;
static PyObject *__pyx_kp_s_77;
static PyObject *__pyx_kp_s_78;
static PyObject *__pyx_kp_s_80;
static PyObject *__pyx_kp_s_82;
static PyObject *__pyx_n_s_87;
static PyObject *__pyx_kp_s_88;
static PyObject *__pyx_n_s_89;
static PyObject *__pyx_kp_s_91;
static PyObject *__pyx_kp_s_94;
static PyObject *__pyx_kp_s_95;
static PyObject *__pyx_kp_s_97;
static PyObject *__pyx_kp_s_99;
static PyObject *__pyx_n_s__AlgorithmBase;
static PyObject *__pyx_n_s__AssimuloFMIAlg;
static PyObject *__pyx_n_s__CS;
static PyObject *__pyx_n_s__Default;
static PyObject *__pyx_n_s__Exception;
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_FIXED;
static PyObject *__pyx_n_s__FMI2_INTEGER;
static PyObject *__pyx_n_s__FMI2_REAL;
static PyObject *__pyx_n_s__FMI2_STRING;
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__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_alias;
static PyObject *__pyx_n_s___get_causality;
static PyObject *__pyx_n_s___get_description;
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__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__capabilities_Num;
static PyObject *__pyx_n_s__categories;
static PyObject *__pyx_n_s__causality;
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__create_temp_dir;
static PyObject *__pyx_n_s__create_temp_file;
static PyObject *__pyx_n_s__cs_canHandleEvents;
static PyObject *__pyx_n_s__cs_canSignalEvents;
static PyObject *__pyx_n_s__current_t;
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__endswith;
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__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_integer;
static PyObject *__pyx_n_s__get_log;
static PyObject *__pyx_n_s__get_model_variables;
static PyObject *__pyx_n_s__get_real;
static PyObject *__pyx_n_s__get_result;
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__i;
static PyObject *__pyx_n_s__include_alias;
static PyObject *__pyx_n_s__input;
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__kind;
static PyObject *__pyx_n_s__last_error;
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__model;
static PyObject *__pyx_n_s__module;
static PyObject *__pyx_n_s__name;
static PyObject *__pyx_n_s__ndmin;
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__path;
static PyObject *__pyx_n_s__prod;
static PyObject *__pyx_n_s__property;
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__relTol;
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__sorted;
static PyObject *__pyx_n_s__start_time;
static PyObject *__pyx_n_s__stateValuesChanged;
static PyObject *__pyx_n_s__step_size;
static PyObject *__pyx_n_s__strip;
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__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__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__variablename;
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__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_7;
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_14;
static PyObject *__pyx_k_84;
static PyObject *__pyx_k_85;
static PyObject *__pyx_k_86;
static PyObject *__pyx_k_90;
static PyObject *__pyx_k_93;
static PyObject *__pyx_k_108;
static PyObject *__pyx_k_113;
static PyObject *__pyx_k_114;
static PyObject *__pyx_k_115;
static PyObject *__pyx_k_120;
static PyObject *__pyx_k_132;
static PyObject *__pyx_k_153;
static PyObject *__pyx_k_161;
static PyObject *__pyx_k_170;
static PyObject *__pyx_k_174;
static PyObject *__pyx_k_175;
static PyObject *__pyx_k_209;
static PyObject *__pyx_k_215;
static PyObject *__pyx_k_216;
static PyObject *__pyx_k_217;
static PyObject *__pyx_k_255;
static PyObject *__pyx_k_260;
static PyObject *__pyx_k_263;
static PyObject *__pyx_k_264;
static PyObject *__pyx_k_265;
static PyObject *__pyx_k_270;
static PyObject *__pyx_k_291;
static PyObject *__pyx_k_292;
static PyObject *__pyx_k_293;
static PyObject *__pyx_k_294;
static PyObject *__pyx_k_298;
static PyObject *__pyx_k_301;
static PyObject *__pyx_k_309;
static PyObject *__pyx_k_320;
static PyObject *__pyx_k_321;
static PyObject *__pyx_k_322;
static PyObject *__pyx_k_323;
static PyObject *__pyx_k_325;
static PyObject *__pyx_k_335;
static PyObject *__pyx_k_tuple_2;
static PyObject *__pyx_k_tuple_17;
static PyObject *__pyx_k_tuple_19;
static PyObject *__pyx_k_tuple_21;
static PyObject *__pyx_k_tuple_24;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_29;
static PyObject *__pyx_k_tuple_30;
static PyObject *__pyx_k_tuple_33;
static PyObject *__pyx_k_tuple_35;
static PyObject *__pyx_k_tuple_36;
static PyObject *__pyx_k_tuple_38;
static PyObject *__pyx_k_tuple_39;
static PyObject *__pyx_k_tuple_42;
static PyObject *__pyx_k_tuple_44;
static PyObject *__pyx_k_tuple_46;
static PyObject *__pyx_k_tuple_48;
static PyObject *__pyx_k_tuple_50;
static PyObject *__pyx_k_tuple_51;
static PyObject *__pyx_k_tuple_53;
static PyObject *__pyx_k_tuple_55;
static PyObject *__pyx_k_tuple_56;
static PyObject *__pyx_k_tuple_58;
static PyObject *__pyx_k_tuple_60;
static PyObject *__pyx_k_tuple_62;
static PyObject *__pyx_k_tuple_64;
static PyObject *__pyx_k_tuple_67;
static PyObject *__pyx_k_tuple_68;
static PyObject *__pyx_k_tuple_74;
static PyObject *__pyx_k_tuple_76;
static PyObject *__pyx_k_tuple_79;
static PyObject *__pyx_k_tuple_81;
static PyObject *__pyx_k_tuple_83;
static PyObject *__pyx_k_tuple_92;
static PyObject *__pyx_k_tuple_96;
static PyObject *__pyx_k_tuple_98;
static PyObject *__pyx_k_tuple_100;
static PyObject *__pyx_k_tuple_102;
static PyObject *__pyx_k_tuple_104;
static PyObject *__pyx_k_tuple_105;
static PyObject *__pyx_k_tuple_107;
static PyObject *__pyx_k_tuple_117;
static PyObject *__pyx_k_tuple_119;
static PyObject *__pyx_k_tuple_123;
static PyObject *__pyx_k_tuple_125;
static PyObject *__pyx_k_tuple_134;
static PyObject *__pyx_k_tuple_136;
static PyObject *__pyx_k_tuple_138;
static PyObject *__pyx_k_tuple_140;
static PyObject *__pyx_k_tuple_142;
static PyObject *__pyx_k_tuple_144;
static PyObject *__pyx_k_tuple_146;
static PyObject *__pyx_k_tuple_148;
static PyObject *__pyx_k_tuple_150;
static PyObject *__pyx_k_tuple_155;
static PyObject *__pyx_k_tuple_158;
static PyObject *__pyx_k_tuple_160;
static PyObject *__pyx_k_tuple_163;
static PyObject *__pyx_k_tuple_165;
static PyObject *__pyx_k_tuple_167;
static PyObject *__pyx_k_tuple_169;
static PyObject *__pyx_k_tuple_172;
static PyObject *__pyx_k_tuple_173;
static PyObject *__pyx_k_tuple_176;
static PyObject *__pyx_k_tuple_177;
static PyObject *__pyx_k_tuple_179;
static PyObject *__pyx_k_tuple_180;
static PyObject *__pyx_k_tuple_183;
static PyObject *__pyx_k_tuple_186;
static PyObject *__pyx_k_tuple_189;
static PyObject *__pyx_k_tuple_190;
static PyObject *__pyx_k_tuple_191;
static PyObject *__pyx_k_tuple_192;
static PyObject *__pyx_k_tuple_193;
static PyObject *__pyx_k_tuple_194;
static PyObject *__pyx_k_tuple_195;
static PyObject *__pyx_k_tuple_196;
static PyObject *__pyx_k_tuple_197;
static PyObject *__pyx_k_tuple_198;
static PyObject *__pyx_k_tuple_199;
static PyObject *__pyx_k_tuple_200;
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_208;
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_218;
static PyObject *__pyx_k_tuple_219;
static PyObject *__pyx_k_tuple_220;
static PyObject *__pyx_k_tuple_223;
static PyObject *__pyx_k_tuple_225;
static PyObject *__pyx_k_tuple_226;
static PyObject *__pyx_k_tuple_228;
static PyObject *__pyx_k_tuple_229;
static PyObject *__pyx_k_tuple_248;
static PyObject *__pyx_k_tuple_250;
static PyObject *__pyx_k_tuple_252;
static PyObject *__pyx_k_tuple_254;
static PyObject *__pyx_k_tuple_256;
static PyObject *__pyx_k_tuple_259;
static PyObject *__pyx_k_tuple_262;
static PyObject *__pyx_k_tuple_267;
static PyObject *__pyx_k_tuple_269;
static PyObject *__pyx_k_tuple_272;
static PyObject *__pyx_k_tuple_273;
static PyObject *__pyx_k_tuple_274;
static PyObject *__pyx_k_tuple_275;
static PyObject *__pyx_k_tuple_276;
static PyObject *__pyx_k_tuple_277;
static PyObject *__pyx_k_tuple_278;
static PyObject *__pyx_k_tuple_280;
static PyObject *__pyx_k_tuple_282;
static PyObject *__pyx_k_tuple_283;
static PyObject *__pyx_k_tuple_284;
static PyObject *__pyx_k_tuple_285;
static PyObject *__pyx_k_tuple_286;
static PyObject *__pyx_k_tuple_287;
static PyObject *__pyx_k_tuple_288;
static PyObject *__pyx_k_tuple_289;
static PyObject *__pyx_k_tuple_290;
static PyObject *__pyx_k_tuple_296;
static PyObject *__pyx_k_tuple_297;
static PyObject *__pyx_k_tuple_300;
static PyObject *__pyx_k_tuple_302;
static PyObject *__pyx_k_tuple_303;
static PyObject *__pyx_k_tuple_304;
static PyObject *__pyx_k_tuple_305;
static PyObject *__pyx_k_tuple_306;
static PyObject *__pyx_k_tuple_307;
static PyObject *__pyx_k_tuple_308;
static PyObject *__pyx_k_tuple_310;
static PyObject *__pyx_k_tuple_313;
static PyObject *__pyx_k_tuple_314;
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_326;
static PyObject *__pyx_k_tuple_327;
static PyObject *__pyx_k_tuple_328;
static PyObject *__pyx_k_tuple_330;
static PyObject *__pyx_k_tuple_331;
static PyObject *__pyx_k_tuple_332;
static PyObject *__pyx_k_tuple_333;
static PyObject *__pyx_k_tuple_334;
static PyObject *__pyx_k_tuple_336;
static PyObject *__pyx_k_tuple_337;
static PyObject *__pyx_k_tuple_338;
static PyObject *__pyx_k_tuple_340;
static PyObject *__pyx_k_tuple_342;
static PyObject *__pyx_k_tuple_345;
static PyObject *__pyx_k_tuple_346;
static PyObject *__pyx_k_tuple_348;
static PyObject *__pyx_k_tuple_351;
static PyObject *__pyx_k_tuple_352;
static PyObject *__pyx_k_tuple_355;
static PyObject *__pyx_k_tuple_357;
static PyObject *__pyx_k_tuple_359;
static PyObject *__pyx_k_tuple_361;
static PyObject *__pyx_k_tuple_364;
static PyObject *__pyx_k_tuple_365;
static PyObject *__pyx_k_tuple_367;
static PyObject *__pyx_k_tuple_385;
static PyObject *__pyx_k_tuple_388;
static PyObject *__pyx_k_tuple_391;
static PyObject *__pyx_k_codeobj_386;
static PyObject *__pyx_k_codeobj_389;
static PyObject *__pyx_k_codeobj_392;

/* "pyfmi\fmi.pyx":112
 * 
 * #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":114
 * 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":115
 *     #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 = 115; __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":118
 * 
 * #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":120
 * 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":121
 *     #print "FMIL: module = %s, log lovel = %d: %s" %(module, log_level, message)
 *     if c.context != NULL:
 *         (<FMUModelBase2>c.context)._logger(module, log_level, message)             # <<<<<<<<<<<<<<
 * 
 * #CALLBACKS
 */
    __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 = 121; __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":124
 * 
 * #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":125
 * #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 = 125; __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 = 125; __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 = 125; __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 = 125; __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 = 125; __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 = 125; __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":126
 * 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 = 126; __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 = 126; __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 = 126; __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 = 126; __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 = 126; __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_1), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __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 = 126; __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 = 126; __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":125
 * #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 = 125; __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 = 125; __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 = 125; __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 = 125; __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 = 125; __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_2, NULL);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __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 = 125; __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":132
 * 
 * #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":135
 *     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":136
 *     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":137
 *     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":138
 *     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 = 138; __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 = 138; __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 = 138; __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 = 138; __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 = 138; __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_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __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 = 138; __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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variable_name,&__pyx_n_s__value,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variable_name);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __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 = 145; __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 = 145; __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":145
 *     """
 * 
 *     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
  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;
  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":163
 *             (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 = __pyx_builtin_basestring;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_variable_name, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":164
 *         """
 *         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_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___set); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __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 = 164; __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_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":166
 *             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 = 166; __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 = 166; __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 = 166; __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 = 166; __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 = 166; __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;
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
      } 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 = 166; __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":167
 *         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 = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_GetItem(__pyx_v_variable_name, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PyObject_GetItem(__pyx_v_value, __pyx_v_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __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 = 167; __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 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __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_1);
  __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":169
 *                 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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);

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

    /* "pyfmi\fmi.pyx":191
 *         """
 *         if isinstance(variable_name, basestring):
 *             return self._get(variable_name) #Scalar case             # <<<<<<<<<<<<<<
 *         else:
 *             ret = []
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __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_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __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;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":193
 *             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 = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_ret = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":194
 *         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 = 194; __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 = 194; __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 = 194; __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 = 194; __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 = 194; __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;
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
      } 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 = 194; __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":195
 *             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 = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_GetItem(__pyx_v_variable_name, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __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 = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __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_7)); __pyx_t_7 = 0;
      __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_ret), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_v_ret));
      __pyx_v_ret = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":196
 *             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_1);
  __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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__module,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_exec_algorithm (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__module);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_algorithm", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_algorithm", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __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 = 198; __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 = 198; __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":198
 *             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":208
 *             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_4));
  __pyx_v_base_path = ((PyObject *)__pyx_kp_s_4);

  /* "pyfmi\fmi.pyx":209
 *         """
 *         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 = 209; __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 = 209; __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 = 209; __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 = 209; __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 = 209; __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 = 209; __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 = 209; __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 = 209; __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 = 209; __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 = 209; __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 = 209; __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 = 209; __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 = 209; __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":210
 *         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 *)__pyx_n_s__algorithm_drivers);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_algdrive, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __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 *)__pyx_n_s__AlgorithmBase);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_AlgorithmBase = __pyx_t_2;
  __pyx_t_2 = 0;

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

    /* "pyfmi\fmi.pyx":213
 * 
 *         if isinstance(algorithm, basestring):
 *             module = __import__(module, globals(), locals(), [algorithm], -1)             # <<<<<<<<<<<<<<
 *             algorithm = getattr(module, algorithm)
 * 
 */
    __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __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 = 213; __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 = 213; __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 = 213; __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 = 213; __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 = 213; __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 = 213; __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 = 213; __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 = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_algorithm);
    PyList_SET_ITEM(__pyx_t_4, 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 = 213; __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_2);
    __Pyx_GIVEREF(__pyx_t_2);
    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_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __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_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_module);
    __pyx_v_module = __pyx_t_4;
    __pyx_t_4 = 0;

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

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

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

  /* "pyfmi\fmi.pyx":221
 * 
 *         # initialize algorithm
 *         alg = algorithm(self, options)             # <<<<<<<<<<<<<<
 *         # solve optimization problem/initialize
 *         alg.solve()
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_1 = PyObject_Call(__pyx_v_algorithm, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_alg = __pyx_t_1;
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":225
 *         alg.solve()
 *         # get and return result
 *         return alg.get_result()             # <<<<<<<<<<<<<<
 * 
 *     def _exec_simulate_algorithm(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_alg, __pyx_n_s__get_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;
  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 *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_exec_simulate_algorithm (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_time);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__final_time);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__module);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options);
        if (likely(values[5])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __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 = 227; __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 = 227; __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":227
 *         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":243
 *             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_4));
  __pyx_v_base_path = ((PyObject *)__pyx_kp_s_4);

  /* "pyfmi\fmi.pyx":244
 *         """
 *         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 = 244; __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 = 244; __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 = 244; __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 = 244; __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 = 244; __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 = 244; __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 = 244; __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 = 244; __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 = 244; __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 = 244; __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 = 244; __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 = 244; __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 = 244; __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 = 244; __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 = 244; __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 = 244; __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":245
 *         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 *)__pyx_n_s__algorithm_drivers);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_algdrive, __pyx_t_3); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((PyObject *)__pyx_n_s__AlgorithmBase);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_AlgorithmBase = __pyx_t_2;
  __pyx_t_2 = 0;

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

    /* "pyfmi\fmi.pyx":248
 * 
 *         if isinstance(algorithm, basestring):
 *             module = __import__(module, globals(), locals(), [algorithm], -1)             # <<<<<<<<<<<<<<
 *             algorithm = getattr(module, algorithm)
 * 
 */
    __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __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 = 248; __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 = 248; __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 = 248; __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 = 248; __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 = 248; __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 = 248; __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 = 248; __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 = 248; __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 = 248; __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 = 248; __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 = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_algorithm);
    PyList_SET_ITEM(__pyx_t_4, 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 = 248; __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_2);
    __Pyx_GIVEREF(__pyx_t_2);
    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_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __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_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_module);
    __pyx_v_module = __pyx_t_4;
    __pyx_t_4 = 0;

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

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

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

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

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

  /* "pyfmi\fmi.pyx":260
 *         alg.solve()
 *         # get and return result
 *         return alg.get_result()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_alg, __pyx_n_s__get_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_default_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_8_default_options[] = "\n        Help method. Gets the options class for the algorithm specified in\n        'algorithm'.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_9_default_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_algorithm = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__module,&__pyx_n_s__algorithm,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_default_options (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__module);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_default_options", 1, 2, 2, 1); {__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, "_default_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __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 = 263; __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_8_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":263
 * 
 * 
 *     def _default_options(self, module, algorithm):             # <<<<<<<<<<<<<<
 *         """
 *         Help method. Gets the options class for the algorithm specified in
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_8_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":268
 *         'algorithm'.
 *         """
 *         module = __import__(module, globals(), locals(), [algorithm], -1)             # <<<<<<<<<<<<<<
 *         algorithm = getattr(module, algorithm)
 * 
 */
  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __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 = 268; __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 = 268; __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 = 268; __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 = 268; __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 = 268; __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 = 268; __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_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 = 268; __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":269
 *         """
 *         module = __import__(module, globals(), locals(), [algorithm], -1)
 *         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 = 269; __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":271
 *         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 = 271; __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 = 271; __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;
  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};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_kp_s_6);
    values[4] = __pyx_k_7;
    values[5] = __pyx_k_8;
    values[6] = __pyx_k_9;
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value_reference);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __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 = 287; __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 = 287; __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":287
 *     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":292
 *                        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":293
 * 
 *         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 = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_value_reference = __pyx_t_1;

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

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

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

  /* "pyfmi\fmi.pyx":298
 *         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 = 298; __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":300
 *         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":308
 *             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":311
 *     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":319
 *             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 = 319; __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":322
 *     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":331
 *             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 = 331; __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":334
 *     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":343
 *             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":346
 *     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":355
 *             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 = 355; __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":358
 *     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":367
 *             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 = 367; __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":370
 *     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":379
 *             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 = 379; __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;
  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};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_kp_s_6);
    values[4] = __pyx_k_10;
    values[5] = __pyx_k_11;
    values[6] = __pyx_k_12;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value_reference);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __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 = 386; __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 = 386; __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":386
 *     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) {
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":391
 *                        alias       = FMIL.fmi2_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":392
 * 
 *         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 = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_value_reference = __pyx_t_1;

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

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

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

  /* "pyfmi\fmi.pyx":397
 *         self._variability     = variability
 *         self._causality       = causality
 *         self._alias           = alias             # <<<<<<<<<<<<<<
 * 
 *     def _get_name(self):
 */
  __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 = 397; __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.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":399
 *         self._alias           = alias
 * 
 *     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":407
 *             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":410
 *     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":418
 *             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 = 418; __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":421
 *     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":430
 *             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 = 430; __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":433
 *     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":442
 *             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":445
 *     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":454
 *             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 = 454; __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":457
 *     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":466
 *             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 = 466; __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":469
 *     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":478
 *             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 = 478; __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 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":485
 *     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":486
 *     """
 *     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        ";
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__;
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;
  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};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_13);

    /* "pyfmi\fmi.pyx":494
 *     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_6);
    values[4] = __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  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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[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 = 494; __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 = 494; __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;
  jm_string __pyx_v_last_error;
  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":502
 * 
 *         #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 = 502; __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 = __pyx_t_1;
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":506
 *         #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":507
 *         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":508
 *         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":509
 *         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 = 509; __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":510
 *         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":511
 *         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":514
 * 
 *         #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":515
 *         #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":516
 *         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":517
 *         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":518
 *         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":519
 *         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":521
 *         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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __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 = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

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

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

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

    /* "pyfmi\fmi.pyx":531
 *                 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 = 531; __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 = 531; __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_17), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __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":532
 *         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 = 532; __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":534
 *             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  = 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 = 534; __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 = 534; __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 = 534; __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 = 534; __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 = 534; __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 = 534; __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 = 534; __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 = 534; __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 = 534; __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 = 534; __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":535
 * 
 *         fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *         fmu_temp_dir  = 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__create_temp_dir); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __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 = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fmu_temp_dir = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":536
 *         fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *         fmu_temp_dir  = 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 = 536; __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":537
 *         fmu_temp_dir  = 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 = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_self->_fmu_temp_dir, __pyx_t_9);

  /* "pyfmi\fmi.pyx":540
 * 
 *         # 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 = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (!__pyx_t_5);
  if (__pyx_t_2) {

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

  /* "pyfmi\fmi.pyx":544
 * 
 *         #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":545
 *         #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":546
 *         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":547
 *         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":549
 *         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":550
 * 
 *         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":553
 * 
 *         #Get the FMI version of the provided model
 *         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 = 553; __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 = 553; __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":554
 *         #Get the FMI version of the provided model
 *         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":556
 *         self._version = version #Store version
 * 
 *         if version == FMIL.fmi_version_unknown_enu:             # <<<<<<<<<<<<<<
 *             last_error = 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":557
 * 
 *         if version == FMIL.fmi_version_unknown_enu:
 *             last_error = 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_v_last_error = jm_get_last_error((&__pyx_v_self->callbacks));

    /* "pyfmi\fmi.pyx":558
 *         if version == FMIL.fmi_version_unknown_enu:
 *             last_error = 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":559
 *             last_error = 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 = 559; __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 = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_22), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __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 = 559; __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 = 559; __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 = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    /*else*/ {

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

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

  /* "pyfmi\fmi.pyx":566
 * 
 *         #Parse the XML
 *         self._fmu = FMIL.fmi1_import_parse_xml(self.context, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *         if self._fmu == NULL:
 *             last_error = 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 = 566; __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":567
 *         #Parse the XML
 *         self._fmu = FMIL.fmi1_import_parse_xml(self.context, fmu_temp_dir)
 *         if self._fmu == NULL:             # <<<<<<<<<<<<<<
 *             last_error = 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":568
 *         self._fmu = FMIL.fmi1_import_parse_xml(self.context, fmu_temp_dir)
 *         if self._fmu == NULL:
 *             last_error = 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_v_last_error = jm_get_last_error((&__pyx_v_self->callbacks));

    /* "pyfmi\fmi.pyx":569
 *         if self._fmu == NULL:
 *             last_error = 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":570
 *             last_error = 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_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_27), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __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 = 570; __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_7, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __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 = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L11;
    }
    /*else*/ {

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

  /* "pyfmi\fmi.pyx":573
 *             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":576
 * 
 *         #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_1 = PyInt_FromLong(fmi1_import_get_fmu_kind(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fmu_kind = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":577
 *         #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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_ME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_fmu_kind, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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 = 577; __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 = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_fmu_kind, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

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

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

  /* "pyfmi\fmi.pyx":583
 *         #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 = FMIL.fmi1_import_get_last_error(self._fmu)
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_31); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __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 = 583; __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":584
 *         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 = 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":585
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);
 *         if status == FMIL.jm_status_error:
 *             last_error = FMIL.fmi1_import_get_last_error(self._fmu)             # <<<<<<<<<<<<<<
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:
 *                 raise FMUException(last_error)
 */
    __pyx_v_last_error = fmi1_import_get_last_error(__pyx_v_self->_fmu);

    /* "pyfmi\fmi.pyx":586
 *         if status == FMIL.jm_status_error:
 *             last_error = 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":587
 *             last_error = 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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __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 = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 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_7), NULL); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__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 = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":589
 *                 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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_33), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __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 = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L14:;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pyfmi\fmi.pyx":590
 *             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":591
 *                 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_7 = __Pyx_GetName(__pyx_m, __pyx_n_s_31); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_31, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":603
 * 
 *         #Load information from model
 *         self._modelid = FMIL.fmi1_import_get_model_identifier(self._fmu)             # <<<<<<<<<<<<<<
 *         self._modelname = FMIL.fmi1_import_get_model_name(self._fmu)
 *         self._nEventIndicators = FMIL.fmi1_import_get_number_of_event_indicators(self._fmu)
 */
  __pyx_t_7 = PyBytes_FromString(fmi1_import_get_model_identifier(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
  __Pyx_GOTREF(__pyx_v_self->_modelid);
  __Pyx_DECREF(__pyx_v_self->_modelid);
  __pyx_v_self->_modelid = ((PyObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "pyfmi\fmi.pyx":604
 *         #Load information from model
 *         self._modelid = FMIL.fmi1_import_get_model_identifier(self._fmu)
 *         self._modelname = 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_7 = PyBytes_FromString(fmi1_import_get_model_name(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
  __Pyx_GOTREF(__pyx_v_self->_modelname);
  __Pyx_DECREF(__pyx_v_self->_modelname);
  __pyx_v_self->_modelname = ((PyObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "pyfmi\fmi.pyx":605
 *         self._modelid = FMIL.fmi1_import_get_model_identifier(self._fmu)
 *         self._modelname = 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 = (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":606
 *         self._modelname = 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 = (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":607
 *         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 = (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_4 = __Pyx_PyString_Equals(__pyx_v_log_file_name, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __pyx_t_1 = PyNumber_Add(__pyx_v_self->_modelid, ((PyObject *)__pyx_kp_s_34)); 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_7 = __pyx_t_1;
    __pyx_t_1 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_log_file_name);
    __pyx_t_7 = __pyx_v_log_file_name;
  }
  __pyx_v_fmu_log_name = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "pyfmi\fmi.pyx":608
 *         self._nContinuousStates = FMIL.fmi1_import_get_number_of_continuous_states(self._fmu)
 *         fmu_log_name = (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 = 608; __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":609
 *         fmu_log_name = (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 = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_self->_fmu_log_name, __pyx_t_10);

  /* "pyfmi\fmi.pyx":612
 * 
 *         #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_7 = PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __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_INCREF(((PyObject *)__pyx_n_s__w));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__w));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w));
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_12 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s____exit__); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s____enter__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L15_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 = 612; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_3);
          __pyx_v_file = __pyx_t_3;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "pyfmi\fmi.pyx":613
 *         #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_3 = ((PyObject *)__pyx_v_self->_log);
          __Pyx_INCREF(__pyx_t_3);
          if (unlikely(__pyx_t_3 == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L19_error;} 
          }
          __pyx_t_16 = PyList_GET_SIZE(__pyx_t_3); 
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L19_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_builtin_range, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
          if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
            __pyx_t_7 = __pyx_t_3; __Pyx_INCREF(__pyx_t_7); __pyx_t_16 = 0;
            __pyx_t_17 = NULL;
          } else {
            __pyx_t_16 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_17 = Py_TYPE(__pyx_t_7)->tp_iternext;
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          for (;;) {
            if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_7)) {
              if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_7)) break;
              __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++;
            } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_7)) {
              if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
              __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++;
            } else {
              __pyx_t_3 = __pyx_t_17(__pyx_t_7);
              if (unlikely(!__pyx_t_3)) {
                if (PyErr_Occurred()) {
                  if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                  else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L19_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":614
 *         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_3 = PyObject_GetAttr(__pyx_v_file, __pyx_n_s__write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self->_log), __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self->_log), __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_18);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self->_log), __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_19 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_8);
            PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_18);
            __Pyx_GIVEREF(__pyx_t_18);
            PyTuple_SET_ITEM(__pyx_t_1, 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_1), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_19));
            __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 = 614; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_19));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_19));
            __pyx_t_19 = 0;
            __pyx_t_19 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "pyfmi\fmi.pyx":615
 *             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 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
          __Pyx_GOTREF(__pyx_v_self->_log);
          __Pyx_DECREF(((PyObject *)__pyx_v_self->_log));
          __pyx_v_self->_log = __pyx_t_7;
          __pyx_t_7 = 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_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "pyfmi\fmi.pyx":612
 * 
 *         #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_7, &__pyx_t_19, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_19);
          PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_19);
          __Pyx_INCREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_20 = PyObject_Call(__pyx_t_12, __pyx_t_3, NULL);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __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 = 612; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __pyx_t_2 = (!__pyx_t_4);
          if (__pyx_t_2) {
            __Pyx_GIVEREF(__pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_ErrRestore(__pyx_t_7, __pyx_t_19, __pyx_t_1);
            __pyx_t_7 = 0; __pyx_t_19 = 0; __pyx_t_1 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
            goto __pyx_L32;
          }
          __pyx_L32:;
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_35, NULL);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __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 = 612; __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_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":618
 * 
 * 
 *     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":619
 * 
 *     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":620
 *     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 = 620; __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 = 620; __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 = 620; __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 = 620; __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 = 620; __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 = 620; __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":621
 *         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 = 621; __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 = 621; __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 = 621; __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 = 621; __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 = 621; __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_1), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __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 = 621; __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 = 621; __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":620
 *     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 = 620; __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 = 620; __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 = 620; __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 = 620; __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 = 620; __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_36, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __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 = 620; __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":623
 *                 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 = 623; __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 = 623; __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 = 623; __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 = 623; __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 = 623; __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 = 623; __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_3get_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_2get_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_3get_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_2get_log(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":639
 *         """
 *         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":640
 *         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 = 640; __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 = 640; __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 = 640; __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 = 640; __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 = 640; __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 = 640; __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":641
 *         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":642
 *             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 = 642; __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 = 642; __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":643
 *                 while True:
 *                     line = file.readline()
 *                     if line == "":             # <<<<<<<<<<<<<<
 *                         break
 *                     log.append(line.strip("\n"))
 */
              __pyx_t_2 = __Pyx_PyString_Equals(__pyx_v_line, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              if (__pyx_t_2) {

                /* "pyfmi\fmi.pyx":644
 *                     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":645
 *                     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 = 645; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_38), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __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 = 645; __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":640
 *         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 = 640; __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 = 640; __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 = 640; __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 = 640; __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 = 640; __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_39, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __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 = 640; __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":646
 *                         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":648
 *         return log
 * 
 *     cpdef _internal_set_fmu_null(self):             # <<<<<<<<<<<<<<
 *         """
 *         This methods is ONLY for testing puposes. It sets the internal
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_5_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 overriden 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_40); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __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_5_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 = 648; __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":653
 *         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_5_internal_set_fmu_null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_4_internal_set_fmu_null[] = "\n        This methods is ONLY for testing puposes. It sets the internal\n        fmu state to NULL\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_5_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_4_internal_set_fmu_null(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":648
 *         return log
 * 
 *     cpdef _internal_set_fmu_null(self):             # <<<<<<<<<<<<<<
 *         """
 *         This methods is ONLY for testing puposes. It sets the internal
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_4_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 = 648; __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_7print_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_6print_log[] = "\n        Prints the log information to the prompt.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_7print_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_6print_log(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_6print_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":660
 *         """
 *         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 = 660; __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 = 660; __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":661
 *         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 = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_3;

  /* "pyfmi\fmi.pyx":663
 *         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":664
 * 
 *         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 = 664; __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 = 664; __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_9_convert_filter(PyObject *__pyx_v_self, PyObject *__pyx_v_expression); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_8_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_9_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_8_convert_filter(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_expression));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":667
 *             #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_8_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":672
 *         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 = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_regexp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":673
 *         """
 *         regexp = []
 *         if isinstance(expression,str):             # <<<<<<<<<<<<<<
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)(&PyString_Type)));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_expression, __pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":674
 *         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 = 674; __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 = 674; __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 = 674; __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 = 674; __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":675
 *         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 = 675; __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 = 675; __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 = 675; __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 = 675; __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 = 675; __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 = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":676
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):             # <<<<<<<<<<<<<<
 *             for i in expression:
 *                 regex = fnmatch.translate(i)
 */
  __pyx_t_4 = ((PyObject *)((PyObject*)(&PyList_Type)));
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_expression, __pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":677
 *             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 = 677; __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;
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
      } 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 = 677; __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":678
 *         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 = 678; __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 = 678; __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 = 678; __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 = 678; __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":679
 *             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 = 679; __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 = 679; __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 = 679; __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 = 679; __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 = 679; __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":681
 *                 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 = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_42), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __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 = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":682
 *         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_11_get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_10_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_11_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_10_get_version(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":684
 *         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_10_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":697
 *             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":698
 *         """
 *         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 = 698; __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_13get_ode_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_12get_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_13get_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_12get_ode_sizes(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":702
 *     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_12get_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":719
 *             [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 = 719; __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 = 719; __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 = 719; __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_15get_real(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_14get_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/fmiSetReal\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15get_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_14get_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":721
 *         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_14get_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":743
 *         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 = 743; __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 = 743; __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 = 743; __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 = 743; __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 = 743; __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 = 743; __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 = 743; __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 = 743; __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 = 743; __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 = 743; __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 = 743; __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 = 743; __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 = 743; __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":744
 *         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 = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

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

  /* "pyfmi\fmi.pyx":753
 *             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_17set_real(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_16set_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: fmiGetReal/fmiSetReal\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_17set_real(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_real (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_real", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __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 = 755; __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 = 755; __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_16set_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":755
 *         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_16set_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":775
 *         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 = 775; __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 = 775; __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 = 775; __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 = 775; __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 = 775; __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 = 775; __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 = 775; __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 = 775; __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 = 775; __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 = 775; __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 = 775; __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 = 775; __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 = 775; __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":776
 *         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 = 776; __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 = 776; __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 = 776; __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 = 776; __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 = 776; __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 = 776; __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 = 776; __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 = 776; __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 = 776; __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 = 776; __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 = 776; __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 = 776; __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 = 776; __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":777
 *         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 = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_8;

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

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

  /* "pyfmi\fmi.pyx":783
 *                 '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":785
 *         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":786
 * 
 *         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 = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_48), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __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 = 786; __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_19get_integer(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_18get_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/fmiSetInteger\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_19get_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_18get_integer(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":788
 *             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_18get_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":810
 *         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 = 810; __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 = 810; __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 = 810; __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 = 810; __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 = 810; __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 = 810; __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 = 810; __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 = 810; __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 = 810; __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 = 810; __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 = 810; __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 = 810; __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 = 810; __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":812
 *         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 = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

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

  /* "pyfmi\fmi.pyx":820
 *             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_21set_integer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_20set_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: fmiGetInteger/fmiSetInteger\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_21set_integer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_integer (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_integer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __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 = 822; __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 = 822; __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_20set_integer(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":822
 *         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_20set_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":842
 *         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 = 842; __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 = 842; __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 = 842; __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 = 842; __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 = 842; __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 = 842; __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 = 842; __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 = 842; __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 = 842; __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 = 842; __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 = 842; __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 = 842; __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 = 842; __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":843
 *         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 = 843; __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 = 843; __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 = 843; __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 = 843; __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 = 843; __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 = 843; __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 = 843; __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 = 843; __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 = 843; __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 = 843; __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 = 843; __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 = 843; __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":845
 *         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 = 845; __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 = 845; __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":847
 *         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 = 847; __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 = 847; __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); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __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 = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_9) {

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

  /* "pyfmi\fmi.pyx":851
 *                 '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":853
 *         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":854
 * 
 *         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 = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_53), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __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 = 854; __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_23get_boolean(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_22get_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/fmiSetBoolean\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23get_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_22get_boolean(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_22get_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":879
 *         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 = 879; __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 = 879; __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 = 879; __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 = 879; __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 = 879; __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 = 879; __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 = 879; __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 = 879; __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 = 879; __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 = 879; __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 = 879; __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 = 879; __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 = 879; __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":881
 *         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 = 881; __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 = 881; __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":883
 *         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":887
 * 
 *         #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":889
 *         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 = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_return_values = __pyx_t_5;
  __pyx_t_5 = 0;

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

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

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

  /* "pyfmi\fmi.pyx":902
 *             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 = 902; __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 = 902; __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 = 902; __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 = 902; __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_25set_boolean(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_24set_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: fmiGetBoolean/fmiSetBoolean\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_25set_boolean(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_boolean (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_boolean", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __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 = 905; __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 = 905; __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_24set_boolean(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":905
 *         #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_24set_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":926
 *         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 = 926; __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 = 926; __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 = 926; __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 = 926; __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 = 926; __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 = 926; __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 = 926; __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 = 926; __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 = 926; __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 = 926; __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 = 926; __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 = 926; __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 = 926; __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":927
 * 
 *         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 = 927; __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 = 927; __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":930
 * 
 *         #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":932
 *         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 = 932; __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 = 932; __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 = 932; __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 = 932; __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 = 932; __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 = 932; __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 = 932; __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 = 932; __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":933
 * 
 *         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":934
 *         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 = 934; __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 = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_9) {

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

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

  /* "pyfmi\fmi.pyx":946
 * 
 *         #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":948
 *         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":950
 *         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":951
 * 
 *         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 = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_58), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __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 = 951; __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_27get_string(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_26get_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/fmiSetString\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_27get_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_26get_string(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":953
 *             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_26get_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":973
 *         Calls the low-level FMI function: fmiGetString/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 = 973; __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_29set_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_28set_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: fmiGetString/fmiSetString\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_29set_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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_string (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_string", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __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 = 990; __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 = 990; __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_28set_string(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":990
 *         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_28set_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":1008
 *         Calls the low-level FMI function: fmiGetString/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 = 1008; __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_31set_debug_logging(PyObject *__pyx_v_self, PyObject *__pyx_v_flag); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_30set_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_31set_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_30set_debug_logging(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_flag));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

  /* "pyfmi\fmi.pyx":1055
 *             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":1056
 * 
 *         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 = 1056; __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 = 1056; __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 = 1056; __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":1058
 *         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":1059
 * 
 *         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 = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_60), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __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 = 1059; __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_33set_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_32set_log_level[] = "\n        Specifices the log level for PyFMI. Note that this is\n        different from the FMU logging which is specificed 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_33set_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 = 1061; __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_32set_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":1061
 *             raise FMUException('Failed to set the debugging option.')
 * 
 *     def set_log_level(self, FMIL.jm_log_level_enu_t level):             # <<<<<<<<<<<<<<
 *         """
 *         Specifices the log level for PyFMI. Note that this is
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_32set_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":1080
 *                     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":1081
 *         """
 *         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 = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_62), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __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 = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1082
 *         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_35set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35set_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 = 1084; __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_34set_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":1084
 *         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_34set_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":1085
 * 
 *     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 = 1085; __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 = 1085; __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_64), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1086
 *     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,char* 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 = 1086; __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 = 1086; __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 = 1086; __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 = 1086; __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_37_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_36_set[] = "\n        Helper method to set, see docstring on set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  char *__pyx_v_variable_name;
  PyObject *__pyx_v_value = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variable_name,&__pyx_n_s__value,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variable_name);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __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 = 1088; __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 = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_variable_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __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 = 1088; __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_36_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":1088
 *         self.set_log_level(level)
 * 
 *     def _set(self,char* variable_name, value):             # <<<<<<<<<<<<<<
 *         """
 *         Helper method to set, see docstring on set.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_36_set(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__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;
  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;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set", 0);
  __Pyx_INCREF(__pyx_v_value);

  /* "pyfmi\fmi.pyx":1097
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variable_name)             # <<<<<<<<<<<<<<
 *         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_variable_name);

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

    /* "pyfmi\fmi.pyx":1099
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variable_name)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variable_name)             # <<<<<<<<<<<<<<
 * 
 *         ref =  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 = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variable_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __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 = 1099; __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 = 1099; __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 = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1101
 *             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":1102
 * 
 *         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":1103
 *         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":1105
 *         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_1 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1106
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 *             if alias_kind == FMI_NEGATED_ALIAS:             # <<<<<<<<<<<<<<
 *                 value = -value
 *             self.set_real([ref], [value])
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __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 = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":1107
 *         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_2 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "pyfmi\fmi.pyx":1108
 *             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_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_real); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __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_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_3, 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 = 1108; __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));
    PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __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(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1109
 *                 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_1 = (__pyx_v_type == fmi1_base_type_int);
  if (!__pyx_t_1) {
    __pyx_t_6 = (__pyx_v_type == fmi1_base_type_enum);
    __pyx_t_7 = __pyx_t_6;
  } else {
    __pyx_t_7 = __pyx_t_1;
  }
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":1110
 *             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_3 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __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_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_7) {

      /* "pyfmi\fmi.pyx":1111
 *         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_2 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pyfmi\fmi.pyx":1112
 *             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_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_integer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_3, 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 = 1112; __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_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __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));
    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __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;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1113
 *                 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_7 = (__pyx_v_type == fmi1_base_type_str);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":1114
 *             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_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_string); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_2, 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 = 1114; __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_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __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_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_2 = 0;
    __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 = 1114; __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1115
 *         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_7 = (__pyx_v_type == fmi1_base_type_bool);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":1116
 *             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_4 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __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 = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_7) {

      /* "pyfmi\fmi.pyx":1117
 *         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_7 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_5 = __Pyx_PyBool_FromLong((!__pyx_t_7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "pyfmi\fmi.pyx":1118
 *             if alias_kind == FMI_NEGATED_ALIAS:
 *                 value = not value
 *             self.set_boolean([ref], [value])             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Type not supported.')
 */
    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_boolean); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __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_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_3, 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 = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = 0;
    __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 = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1120
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_67), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __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 = 1120; __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39_get(PyObject *__pyx_v_self, PyObject *__pyx_arg_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_38_get[] = "\n        Helper method to get, see docstring on get.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39_get(PyObject *__pyx_v_self, PyObject *__pyx_arg_variable_name) {
  char *__pyx_v_variable_name;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get (wrapper)", 0);
  assert(__pyx_arg_variable_name); {
    __pyx_v_variable_name = PyBytes_AsString(__pyx_arg_variable_name); if (unlikely((!__pyx_v_variable_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_38_get(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_38_get(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__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;
  PyObject *__pyx_v_value = 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;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get", 0);

  /* "pyfmi\fmi.pyx":1132
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variable_name)             # <<<<<<<<<<<<<<
 *         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_variable_name);

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

    /* "pyfmi\fmi.pyx":1134
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variable_name)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variable_name)             # <<<<<<<<<<<<<<
 * 
 *         ref =  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 = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variable_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __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 = 1134; __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 = 1134; __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 = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1136
 *             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":1137
 * 
 *         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":1138
 *         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":1140
 *         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_1 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1141
 * 
 *         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_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_real); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__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 = 1141; __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 = 1141; __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_v_value = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":1142
 *         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_3 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __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); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_1) {
      __pyx_t_5 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_v_value); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __pyx_t_5;
      __pyx_t_5 = 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":1143
 *             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_1 = (__pyx_v_type == fmi1_base_type_int);
  if (!__pyx_t_1) {
    __pyx_t_6 = (__pyx_v_type == fmi1_base_type_enum);
    __pyx_t_7 = __pyx_t_6;
  } else {
    __pyx_t_7 = __pyx_t_1;
  }
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":1144
 *             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_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_integer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __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 = 1144; __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_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_v_value = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":1145
 *         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_5 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __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 = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_7) {
      __pyx_t_3 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_t_3;
      __pyx_t_3 = 0;
    } else {
      __Pyx_INCREF(__pyx_v_value);
      __pyx_t_4 = __pyx_v_value;
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1146
 *             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_7 = (__pyx_v_type == fmi1_base_type_str);
  if (__pyx_t_7) {

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

  /* "pyfmi\fmi.pyx":1148
 *         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_7 = (__pyx_v_type == fmi1_base_type_bool);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":1149
 *             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_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_boolean); 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_3 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __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 = 1149; __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_v_value = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":1150
 *         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_3 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __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 = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_7) {
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_5 = __Pyx_PyBool_FromLong((!__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __Pyx_INCREF(__pyx_v_value);
      __pyx_t_4 = __pyx_v_value;
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1152
 *             return not value if alias_kind == FMI_NEGATED_ALIAS else value
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_description(self, char* variablename):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_68), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __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 = 1152; __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  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;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_description", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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_69); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41get_variable_description)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __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 = 1154; __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 = 1154; __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":1170
 *         cdef char* desc
 * 
 *         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":1171
 * 
 *         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_4 = (__pyx_v_variable == NULL);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":1174
 *             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":1176
 *         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,char* variablename) except *:
 */
  __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 = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
    __pyx_t_3 = ((PyObject *)__pyx_kp_s_6);
  }
  __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.get_variable_description", __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_41get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_40get_variable_description[] = "\n        Get the description of a given variable.\n\n        Parameter::\n\n            variablename --\n                The name of the variable\n\n        Returns::\n\n            The description of the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_description (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 = 1154; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_40get_variable_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_40get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __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":1178
 *         return desc if desc != NULL else ""
 * 
 *     cpdef FMIL.fmi1_base_type_enu_t get_variable_data_type(self,char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get data type of variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*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, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_base_type_enu_t __pyx_v_type;
  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;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_data_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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_70); 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);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_data_type)) {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __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 = 1178; __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 = 1178; __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 = ((enum fmi1_base_type_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":1194
 *         cdef FMIL.fmi1_base_type_enu_t type
 * 
 *         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":1195
 * 
 *         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":1196
 *         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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __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 = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __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 = 1196; __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 = 1196; __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 = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1198
 *             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":1200
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 *         return type             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_value_reference_t get_variable_valueref(self, char* variablename) 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_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_42get_variable_data_type[] = "\n        Get data type of variable.\n\n        Parameter::\n\n            variablename --\n                The name of the variable.\n\n        Returns::\n\n            The type of the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_data_type (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 = 1178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_data_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_42get_variable_data_type(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_42get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __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 = 1178; __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":1202
 *         return type
 * 
 *     cpdef FMIL.fmi1_value_reference_t get_variable_valueref(self, char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Extract the ValueReference given a variable name.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static fmi1_value_reference_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_value_reference_t __pyx_v_vr;
  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;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_valueref", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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_71); 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);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_valueref)) {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __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 = 1202; __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 = 1202; __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 = __Pyx_PyInt_from_py_fmi1_value_reference_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (fmi1_value_reference_t)-1) && PyErr_Occurred())) {__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_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":1218
 *         cdef FMIL.fmi1_value_reference_t vr
 * 
 *         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":1219
 * 
 *         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_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

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

  /* "pyfmi\fmi.pyx":1221
 *         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":1223
 *         vr =  FMIL.fmi1_import_get_variable_vr(variable)
 * 
 *         return vr             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_nominal(self, variablename=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_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_44get_variable_valueref[] = "\n        Extract the ValueReference given a variable name.\n\n        Parameters::\n\n            variablename --\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_45get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_valueref (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 = 1202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_44get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_44get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __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 = 1202; __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_47get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_46get_variable_nominal[] = "\n        Returns the nominal value from a real variable determined by\n        either its value reference or its variable name.\n\n        Parameters::\n\n            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_47get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variablename = 0;
  PyObject *__pyx_v_valueref = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variablename,&__pyx_n_s__valueref,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_nominal (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};

    /* "pyfmi\fmi.pyx":1225
 *         return vr
 * 
 *     def get_variable_nominal(self, variablename=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__variablename);
          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 = 1225; __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_variablename = 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 = 1225; __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_46get_variable_nominal(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_variablename, __pyx_v_valueref);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_46get_variable_nominal(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variablename, PyObject *__pyx_v_valueref) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_real_variable_t *__pyx_v_real_variable;
  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);

  /* "pyfmi\fmi.pyx":1244
 *         cdef FMIL.fmi1_import_real_variable_t *real_variable
 * 
 *         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); 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_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 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_2) {

    /* "pyfmi\fmi.pyx":1245
 * 
 *         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 = 1245; __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":1246
 *         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 variablename != None:
 */
    __pyx_t_2 = (__pyx_v_variable == NULL);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":1247
 *             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 variablename != None:
 *             variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __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 = 1247; __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 = 1247; __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_72), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __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 = 1247; __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 = 1247; __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 = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }

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

    /* "pyfmi\fmi.pyx":1249
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 *         elif variablename != None:
 *             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 = PyBytes_AsString(__pyx_v_variablename); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_t_6);

    /* "pyfmi\fmi.pyx":1250
 *         elif variablename != None:
 *             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":1251
 *             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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), __pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 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_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L3;
  }
  /*else*/ {

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

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

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

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

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

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_variable_fixed(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  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;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_fixed", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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 = 1261; __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_49get_variable_fixed)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __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 = 1261; __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 = 1261; __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":1278
 *         cdef FMIL.fmi1_import_variable_t *variable
 * 
 *         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":1279
 * 
 *         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_4 = (__pyx_v_variable == NULL);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1280
 *         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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); 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);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __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 = 1280; __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 = 1280; __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 = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1282
 *             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":1284
 *         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_4 = (__pyx_v_status == 0);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":1287
 *             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":1289
 *         fixed = FMIL.fmi1_import_get_variable_is_fixed(variable)
 * 
 *         return fixed==1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_fixed == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_fixed", __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_49get_variable_fixed(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_48get_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            variablename --\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_49get_variable_fixed(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_fixed (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 = 1261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_fixed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_variable_fixed(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_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":1292
 * 
 * 
 *     cpdef get_variable_start(self,char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the start value for the variable or else raises
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, 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;
  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("get_variable_start", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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 = 1292; __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_start)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __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 = 1292; __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 = 1292; __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":1314
 *         cdef FMIL.fmi1_base_type_enu_t type
 *         cdef int status
 *         cdef FMIL.fmi1_boolean_t FMITRUE = 1             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_v_FMITRUE = 1;

  /* "pyfmi\fmi.pyx":1316
 *         cdef FMIL.fmi1_boolean_t FMITRUE = 1
 * 
 *         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":1317
 * 
 *         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_4 = (__pyx_v_variable == NULL);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":1320
 *             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":1322
 *         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_4 = (__pyx_v_status == 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1323
 * 
 *         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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); 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_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_77), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __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 = 1323; __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 = 1323; __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 = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1325
 *             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":1327
 *         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_4 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1328
 * 
 *         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":1329
 *         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_1 = PyFloat_FromDouble(fmi1_import_get_real_variable_start(__pyx_v_real_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":1331
 *             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_4 = (__pyx_v_type == fmi1_base_type_int);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1332
 * 
 *         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":1333
 *         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_1 = PyInt_FromLong(fmi1_import_get_integer_variable_start(__pyx_v_int_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":1335
 *             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_4 = (__pyx_v_type == fmi1_base_type_bool);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1336
 * 
 *         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":1337
 *         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_1 = __Pyx_PyBool_FromLong((fmi1_import_get_boolean_variable_start(__pyx_v_bool_variable) == __pyx_v_FMITRUE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":1339
 *             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_4 = (__pyx_v_type == fmi1_base_type_enum);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1340
 * 
 *         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":1341
 *         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_1 = PyInt_FromLong(fmi1_import_get_enum_variable_start(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":1343
 *             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_4 = (__pyx_v_type == fmi1_base_type_str);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1344
 * 
 *         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":1345
 *         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_1 = PyBytes_FromString(fmi1_import_get_string_variable_start(__pyx_v_str_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __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;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1348
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self,char* variablename):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_79), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __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 = 1348; __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_50get_variable_start[] = "\n        Returns the start value for the variable or else raises\n        FMUException.\n\n        Parameters::\n\n            variablename --\n                The name of the variable\n\n        Returns::\n\n            The start value.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_start (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 = 1292; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_50get_variable_start(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_50get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __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":1350
 *             raise FMUException("Unknown variable type.")
 * 
 *     cpdef get_variable_max(self,char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the maximum value for the given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, 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;
  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("get_variable_max", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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 = 1350; __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_max)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __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 = 1350; __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 = 1350; __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":1369
 *         cdef FMIL.fmi1_base_type_enu_t type
 * 
 *         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":1370
 * 
 *         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_4 = (__pyx_v_variable == NULL);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1371
 *         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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __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 = 1371; __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 = 1371; __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 = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1373
 *             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":1375
 *         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_4 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1376
 * 
 *         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":1377
 *         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_3 = PyFloat_FromDouble(fmi1_import_get_real_variable_max(__pyx_v_real_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __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;
  }

  /* "pyfmi\fmi.pyx":1379
 *             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_4 = (__pyx_v_type == fmi1_base_type_int);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1380
 * 
 *         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":1381
 *         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_3 = PyInt_FromLong(fmi1_import_get_integer_variable_max(__pyx_v_int_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __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;
  }

  /* "pyfmi\fmi.pyx":1383
 *             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_4 = (__pyx_v_type == fmi1_base_type_enum);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1384
 * 
 *         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":1385
 *         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_3 = PyInt_FromLong(fmi1_import_get_enum_variable_max(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __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":1388
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self,char* variablename):
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_81), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __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 = 1388; __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_52get_variable_max[] = "\n        Returns the maximum value for the given variable.\n\n        Parameters::\n\n            variablename --\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_53get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_max (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 = 1350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_variable_max(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1350
 *             raise FMUException("Unknown variable type.")
 * 
 *     cpdef get_variable_max(self,char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the maximum value for the given variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __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":1390
 *             raise FMUException("The variable type does not have a maximum value.")
 * 
 *     cpdef get_variable_min(self,char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the minimum value for the given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, 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;
  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("get_variable_min", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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 = 1390; __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_min)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __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 = 1390; __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 = 1390; __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":1409
 *         cdef FMIL.fmi1_base_type_enu_t type
 * 
 *         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":1410
 * 
 *         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_4 = (__pyx_v_variable == NULL);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":1413
 *             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":1415
 *         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_4 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1416
 * 
 *         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":1417
 *         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_3 = PyFloat_FromDouble(fmi1_import_get_real_variable_min(__pyx_v_real_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __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;
  }

  /* "pyfmi\fmi.pyx":1419
 *             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_4 = (__pyx_v_type == fmi1_base_type_int);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1420
 * 
 *         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":1421
 *         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_3 = PyInt_FromLong(fmi1_import_get_integer_variable_min(__pyx_v_int_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1423
 *             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_4 = (__pyx_v_type == fmi1_base_type_enum);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1424
 * 
 *         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":1425
 *         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_3 = PyInt_FromLong(fmi1_import_get_enum_variable_min(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __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":1428
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_83), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __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 = 1428; __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_54get_variable_min[] = "\n        Returns the minimum value for the given variable.\n\n        Parameters::\n\n            variablename --\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_55get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_min (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 = 1390; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_min(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1390
 *             raise FMUException("The variable type does not have a maximum value.")
 * 
 *     cpdef get_variable_min(self,char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the minimum value for the given variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); 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_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_57get_model_variables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_56get_model_variables[] = "\n        Extract the names of the variables in a model.\n\n        Parameters::\n\n            type --\n                The type of the variables (Real==0, Int==1, Bool=2,\n                String==3, Enumeration==4). 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_57get_model_variables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_include_alias = 0;
  PyObject *__pyx_v_causality = 0;
  PyObject *__pyx_v_variability = 0;
  PyObject *__pyx_v_only_start = 0;
  PyObject *__pyx_v_only_fixed = 0;
  PyObject *__pyx_v_filter = 0;
  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 *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_variables (wrapper)", 0);
  {
    PyObject* values[7] = {0,0,0,0,0,0,0};

    /* "pyfmi\fmi.pyx":1431
 * 
 * 
 *     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_84;

    /* "pyfmi\fmi.pyx":1432
 * 
 *     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_85;
    values[5] = __pyx_k_86;

    /* "pyfmi\fmi.pyx":1434
 *                             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 = 1431; __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 = 1431; __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_56get_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":1431
 * 
 * 
 *     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_56get_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;
  char *__pyx_v_name;
  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;
  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":1478
 *         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 = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_variable_dict = __pyx_t_1;
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":1480
 *         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":1481
 *         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":1482
 *         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":1484
 *         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 = 1484; __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":1485
 *         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":1487
 *         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":1488
 * 
 *         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":1490
 *         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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __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 = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

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

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

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

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

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

    /* "pyfmi\fmi.pyx":1498
 *         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":1499
 *             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":1500
 *             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 = 1500; __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 = 1500; __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 = 1500; __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 = 1500; __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":1501
 *         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 = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_9 = PyList_GET_SIZE(((PyObject *)__pyx_v_filter_list)); 
    __pyx_v_length_filter = __pyx_t_9;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":1503
 *             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":1505
 *         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":1507
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             name       = 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":1508
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = 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_v_name = fmi1_import_get_variable_name(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1509
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = 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":1510
 *             name       = 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":1511
 *             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":1512
 *             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":1513
 *             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":1514
 *             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":1517
 * 
 *             #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 = 1517; __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":1518
 *             #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":1520
 *                 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 = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {

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

        /* "pyfmi\fmi.pyx":1522
 *             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":1524
 *                     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":1525
 *                 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":1526
 *                     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":1528
 *                         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":1529
 * 
 *             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":1530
 *             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":1531
 *                 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":1532
 *             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":1533
 *                 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":1535
 *                 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":1536
 * 
 *             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":1537
 *             if selected_filter:
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__match); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __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_GetItemInt_List(((PyObject *)__pyx_v_filter_list), __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_16, 1, ((PyObject *)__pyx_t_1));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
        __pyx_t_8 = 0;
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __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_16)); __pyx_t_16 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_13) {

          /* "pyfmi\fmi.pyx":1538
 *                 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":1540
 *                         break
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if include_alias:
 */
        goto __pyx_L7_continue;
      }
      __pyx_L18_break:;
      goto __pyx_L16;
    }
    __pyx_L16:;

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

      /* "pyfmi\fmi.pyx":1543
 * 
 *             if include_alias:
 *                 variable_dict[name] = ScalarVariable(name,             # <<<<<<<<<<<<<<
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 */
      __pyx_t_1 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));

      /* "pyfmi\fmi.pyx":1544
 *             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_16 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_7 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if ((__pyx_v_desc != NULL)) {
        __pyx_t_17 = ((PyObject *)PyUnicode_DecodeUTF8(__pyx_v_desc, strlen(__pyx_v_desc), NULL)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_17));
        __pyx_t_8 = ((PyObject *)__pyx_t_17);
        __pyx_t_17 = 0;
      } else {
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
        __pyx_t_8 = ((PyObject *)__pyx_kp_s_6);
      }

      /* "pyfmi\fmi.pyx":1545
 *                 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_17 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_18 = PyInt_FromLong(__pyx_v_data_causality); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_18);

      /* "pyfmi\fmi.pyx":1546
 *                                        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_19 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_20 = PyTuple_New(7); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_20, 4, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_20, 5, __pyx_t_18);
      __Pyx_GIVEREF(__pyx_t_18);
      PyTuple_SET_ITEM(__pyx_t_20, 6, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      __pyx_t_1 = 0;
      __pyx_t_16 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_17 = 0;
      __pyx_t_18 = 0;
      __pyx_t_19 = 0;
      __pyx_t_19 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable)), ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __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":1543
 * 
 *             if include_alias:
 *                 variable_dict[name] = ScalarVariable(name,             # <<<<<<<<<<<<<<
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 */
      __pyx_t_20 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_20));
      if (PyDict_SetItem(((PyObject *)__pyx_v_variable_dict), ((PyObject *)__pyx_t_20), __pyx_t_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      goto __pyx_L20;
    }

    /* "pyfmi\fmi.pyx":1548
 *                                        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":1549
 * 
 *             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,
 */
      __pyx_t_19 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_19));

      /* "pyfmi\fmi.pyx":1550
 *             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_20 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_18 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_18);
      if ((__pyx_v_desc != NULL)) {
        __pyx_t_8 = ((PyObject *)PyUnicode_DecodeUTF8(__pyx_v_desc, strlen(__pyx_v_desc), NULL)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_8));
        __pyx_t_17 = ((PyObject *)__pyx_t_8);
        __pyx_t_8 = 0;
      } else {
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
        __pyx_t_17 = ((PyObject *)__pyx_kp_s_6);
      }

      /* "pyfmi\fmi.pyx":1551
 *                 variable_dict[name] = ScalarVariable(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,             # <<<<<<<<<<<<<<
 *                                        alias_kind)
 * 
 */
      __pyx_t_8 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = PyInt_FromLong(__pyx_v_data_causality); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);

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

      /* "pyfmi\fmi.pyx":1549
 * 
 *             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,
 */
      __pyx_t_1 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      if (PyDict_SetItem(((PyObject *)__pyx_v_variable_dict), ((PyObject *)__pyx_t_1), __pyx_t_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      goto __pyx_L20;
    }
    __pyx_L20:;
    __pyx_L7_continue:;
  }

  /* "pyfmi\fmi.pyx":1555
 * 
 *         #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":1557
 *         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_XDECREF(__pyx_t_20);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_59get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_58get_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_59get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filter = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filter,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_time_varying_value_references (wrapper)", 0);
  {
    PyObject* values[1] = {0};

    /* "pyfmi\fmi.pyx":1559
 *         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 = 1559; __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 = 1559; __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_58get_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_58get_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;
  char *__pyx_v_name;
  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;
  PyObject *__pyx_t_14 = 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":1584
 *         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 = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_variable_dict = __pyx_t_1;
  __pyx_t_1 = 0;

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

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

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

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

  /* "pyfmi\fmi.pyx":1589
 *         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":1590
 *         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 = 1590; __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":1591
 *         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":1593
 *         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":1594
 * 
 *         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":1596
 *         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":1597
 * 
 *         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 = 1597; __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 = 1597; __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 = 1597; __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 = 1597; __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":1598
 *         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 = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_6 = PyList_GET_SIZE(((PyObject *)__pyx_v_filter_list)); 
    __pyx_v_length_filter = __pyx_t_6;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1600
 *             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":1602
 *         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":1604
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             name       = 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":1605
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = 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_name = fmi1_import_get_variable_name(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1606
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = 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":1607
 *             name       = 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:
 */
    __pyx_v_data_type = fmi1_import_get_variable_base_type(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1609
 *             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:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_REAL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __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(__pyx_v_data_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_INTEGER); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __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_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_BOOLEAN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_11 = __pyx_t_10;
      } else {
        __pyx_t_11 = __pyx_t_9;
      }
      __pyx_t_9 = __pyx_t_11;
    } else {
      __pyx_t_9 = __pyx_t_3;
    }
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":1610
 * 
 *             if data_type != FMI_REAL and data_type != FMI_INTEGER and data_type != FMI_BOOLEAN:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if data_variability != FMI_CONTINUOUS and data_variability != FMI_DISCRETE:
 */
      goto __pyx_L4_continue;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pyfmi\fmi.pyx":1612
 *                 continue
 * 
 *             if data_variability != FMI_CONTINUOUS and data_variability != FMI_DISCRETE:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_CONTINUOUS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __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 = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_DISCRETE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = __pyx_t_3;
    } else {
      __pyx_t_11 = __pyx_t_9;
    }
    if (__pyx_t_11) {

      /* "pyfmi\fmi.pyx":1613
 * 
 *             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":1615
 *                 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":1616
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     if re.match(filter_list[j], name):
 *                         break
 */
      __pyx_t_12 = __pyx_v_length_filter;
      for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
        __pyx_v_j = __pyx_t_13;

        /* "pyfmi\fmi.pyx":1617
 *             if selected_filter:
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__match); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_filter_list), __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_14, 1, ((PyObject *)__pyx_t_5));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
        __pyx_t_1 = 0;
        __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __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_14)); __pyx_t_14 = 0;
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_11) {

          /* "pyfmi\fmi.pyx":1618
 *                 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":1620
 *                         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":1622
 *                     continue
 *             else:
 *                 if alias_kind != FMIL.fmi1_variable_is_not_alias:             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
      __pyx_t_11 = (__pyx_v_alias_kind != fmi1_variable_is_not_alias);
      if (__pyx_t_11) {

        /* "pyfmi\fmi.pyx":1623
 *             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":1625
 *                     continue
 * 
 *             if alias_kind == FMIL.fmi1_variable_is_not_alias:             # <<<<<<<<<<<<<<
 *                 value_ref = FMIL.fmi1_import_get_variable_vr(variable)
 *             else:
 */
    __pyx_t_11 = (__pyx_v_alias_kind == fmi1_variable_is_not_alias);
    if (__pyx_t_11) {

      /* "pyfmi\fmi.pyx":1626
 * 
 *             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":1628
 *                 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":1629
 *             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":1631
 *                 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:
 */
    __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_REAL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_14, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_11) {

      /* "pyfmi\fmi.pyx":1632
 * 
 *             if data_type == FMI_REAL:
 *                 real_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 *             if data_type == FMI_INTEGER:
 *                 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 = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "pyfmi\fmi.pyx":1633
 *             if data_type == FMI_REAL:
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI_INTEGER:             # <<<<<<<<<<<<<<
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI_BOOLEAN:
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_INTEGER); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_14, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_11) {

      /* "pyfmi\fmi.pyx":1634
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI_INTEGER:
 *                 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 = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "pyfmi\fmi.pyx":1635
 *             if data_type == FMI_INTEGER:
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI_BOOLEAN:             # <<<<<<<<<<<<<<
 *                 bool_var_ref[value_ref] = 1
 * 
 */
    __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_BOOLEAN); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_14, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_11) {

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

  /* "pyfmi\fmi.pyx":1639
 * 
 *         #Free the variable list
 *         FMIL.fmi1_import_free_variable_list(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         return real_var_ref.keys(), int_var_ref.keys(), bool_var_ref.keys()
 */
  fmi1_import_free_variable_list(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":1641
 *         FMIL.fmi1_import_free_variable_list(variable_list)
 * 
 *         return real_var_ref.keys(), int_var_ref.keys(), bool_var_ref.keys()             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_alias_base(self, char* variablename):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyDict_Keys(__pyx_v_real_var_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_14 = PyDict_Keys(__pyx_v_int_var_ref); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_5 = PyDict_Keys(__pyx_v_bool_var_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __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);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_4 = 0;
  __pyx_t_14 = 0;
  __pyx_t_5 = 0;
  __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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_14);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_variable_alias_base(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_60get_variable_alias_base[] = "\n        Returns the base variable for the provided variable name.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_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 = 1643; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.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_12FMUModelBase_60get_variable_alias_base(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1643
 *         return real_var_ref.keys(), int_var_ref.keys(), bool_var_ref.keys()
 * 
 *     def get_variable_alias_base(self, char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the base variable for the provided variable name.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_60get_variable_alias_base(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_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":1650
 *         cdef FMIL.fmi1_value_reference_t vr
 * 
 *         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":1651
 * 
 *         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_1 = (__pyx_v_variable == NULL);
  if (__pyx_t_1) {

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

  /* "pyfmi\fmi.pyx":1654
 *             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":1655
 * 
 *         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_1 = (__pyx_v_base_variable == NULL);
  if (__pyx_t_1) {

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

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

  /* "pyfmi\fmi.pyx":1660
 *         name = FMIL.fmi1_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 = 1660; __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.FMUModelBase.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_12FMUModelBase_63get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_62get_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_63get_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 = 1662; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_62get_variable_alias(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1662
 *         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_12FMUModelBase_62get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  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;
  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":1681
 *         cdef FMIL.size_t alias_list_size
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 *         cdef dict ret_values = {}             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_ret_values = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1683
 *         cdef dict ret_values = {}
 * 
 *         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":1684
 * 
 *         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_2 = (__pyx_v_variable == NULL);
  if (__pyx_t_2) {

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

  /* "pyfmi\fmi.pyx":1687
 *             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":1689
 *         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":1692
 * 
 *         #Loop over all the alias variables
 *         for i in range(alias_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi1_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":1694
 *         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":1696
 *             variable = FMIL.fmi1_import_get_variable(alias_list, i)
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             alias_name = FMIL.fmi1_import_get_variable_name(variable)
 * 
 */
    __pyx_v_alias_kind = fmi1_import_get_variable_alias_kind(__pyx_v_variable);

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

    /* "pyfmi\fmi.pyx":1699
 *             alias_name = FMIL.fmi1_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 = 1699; __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 = 1699; __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 = 1699; __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":1702
 * 
 *         #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":1704
 *         FMIL.fmi1_import_free_variable_list(alias_list)
 * 
 *         return ret_values             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_variability_enu_t get_variable_variability(self,char* variablename) 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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1706
 *         return ret_values
 * 
 *     cpdef FMIL.fmi1_variability_enu_t get_variable_variability(self,char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get variability of variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static enum fmi1_variability_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_variability_enu_t __pyx_v_variability;
  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;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_variability", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_87); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __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_65get_variable_variability)) {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __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 = 1706; __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 = 1706; __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 = ((enum fmi1_variability_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":1724
 *         cdef FMIL.fmi1_variability_enu_t variability
 * 
 *         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":1725
 * 
 *         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_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

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

  /* "pyfmi\fmi.pyx":1727
 *         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":1729
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_64get_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_65get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_variability (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 = 1706; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_variability", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_64get_variable_variability(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1706
 *         return ret_values
 * 
 *     cpdef FMIL.fmi1_variability_enu_t get_variable_variability(self,char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get variability of variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_64get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __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 = 1706; __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_67get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_66get_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_67get_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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__type,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_by_valueref (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
        if (likely(values[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 = 1731; __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 = 1731; __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 = 1731; __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_66get_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":1731
 *         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_66get_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;
  char *__pyx_v_name;
  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":1747
 *         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 = 1747; __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":1748
 * 
 *         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":1749
 *         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 = 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 = 1749; __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 = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_88), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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 = 1749; __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 = 1749; __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 = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

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

  /* "pyfmi\fmi.pyx":1753
 *         name = FMIL.fmi1_import_get_variable_name(variable)
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_causality_enu_t get_variable_causality(self, char* variablename) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __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_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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1755
 *         return name
 * 
 *     cpdef FMIL.fmi1_causality_enu_t get_variable_causality(self, char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get the causality of the variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static enum fmi1_causality_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_causality_enu_t __pyx_v_causality;
  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;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_causality", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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_89); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __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_69get_variable_causality)) {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __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 = 1755; __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 = 1755; __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 = ((enum fmi1_causality_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":1772
 *         cdef FMIL.fmi1_causality_enu_t causality
 * 
 *         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":1773
 * 
 *         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":1774
 *         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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __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 = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __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 = 1774; __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 = 1774; __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 = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1776
 *             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":1778
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_68get_variable_causality[] = "\n        Get the causality of the variable.\n\n        Parameters::\n\n            variablename --\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_69get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_causality (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 = 1755; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_causality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_68get_variable_causality(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1755
 *         return name
 * 
 *     cpdef FMIL.fmi1_causality_enu_t get_variable_causality(self, char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get the causality of the variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_68get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __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 = 1755; __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_71get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_70get_name[] = "\n        Return the model name as used in the modeling environment.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_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_70get_name(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* "pyfmi\fmi.pyx":1784
 *         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_73get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_72get_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_73get_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_72get_identifier(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_74get_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":1798
 *         """
 *         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":1799
 *         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 = 1799; __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_6));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_6);
  }
  __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_77get_default_experiment_start_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_76get_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_77get_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_76get_default_experiment_start_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1801
 *         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_76get_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":1806
 *         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 = 1806; __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_79get_default_experiment_stop_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_78get_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_79get_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_78get_default_experiment_stop_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1808
 *         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_78get_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":1813
 *         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 = 1813; __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_81get_default_experiment_tolerance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_80get_default_experiment_tolerance[] = "\n        Returns the default experiment tolerance as defined in the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_81get_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_80get_default_experiment_tolerance(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1815
 *         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_80get_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":1820
 *         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 = 1820; __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_83get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_82get_description[] = "\n        Return the model description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_83get_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_82get_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1822
 *         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_82get_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":1827
 *         """
 *         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":1828
 *         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 = 1828; __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_6));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_6);
  }
  __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_85get_generation_tool(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_84get_generation_tool[] = "\n        Return the model generation tool.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_85get_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_84get_generation_tool(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_84get_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":1835
 *         """
 *         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":1836
 *         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 = 1836; __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_6));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_6);
  }
  __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_87get_guid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_86get_guid[] = "\n        Return the model GUID.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_87get_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_86get_guid(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_86get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  char *__pyx_v_guid;
  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_guid", 0);

  /* "pyfmi\fmi.pyx":1842
 *         Return the model GUID.
 *         """
 *         guid = FMIL.fmi1_import_get_GUID(self._fmu)             # <<<<<<<<<<<<<<
 *         return guid
 * 
 */
  __pyx_v_guid = fmi1_import_get_GUID(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":1843
 *         """
 *         guid = FMIL.fmi1_import_get_GUID(self._fmu)
 *         return guid             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_guid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1843; __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_guid", __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":87
 * 
 *     #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":88
 *     #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":89
 *     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":90
 *     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":91
 *     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":100
 *     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 = 100; __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":101
 *     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 = 101; __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":102
 *     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 = 102; __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;
  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};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_13);

    /* "pyfmi\fmi.pyx":1850
 *     #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_6);
    values[4] = __pyx_k_90;
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[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 = 1850; __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 = 1850; __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":1852
 *     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 = 1852; __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 = 1852; __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 = 1852; __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":1854
 *         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 = 1854; __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 = 1854; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __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 = 1854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":1857
 *             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 = 1857; __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 = 1857; __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 = 1857; __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 = 1857; __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":1859
 *         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 overriden 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 = 1859; __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 = 1859; __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":1860
 * 
 *     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":1859
 *         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 = 1859; __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":1862
 *         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 overriden 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 = 1862; __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 = 1862; __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 = 1862; __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 = 1862; __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":1863
 * 
 *     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 = 1863; __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 = 1862; __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":1862
 *         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 = 1862; __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":1871
 *     """)
 * 
 *     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":1875
 *         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":1876
 *         """
 *         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":1877
 *         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":1879
 *             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":1880
 * 
 *         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":1882
 *             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":1883
 * 
 *         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":1885
 *             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":1886
 * 
 *         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":1887
 *         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":1888
 *             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":1890
 *             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":1891
 * 
 *         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":1893
 *             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":1894
 * 
 *         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":1895
 *         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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__current_t,&__pyx_n_s__step_size,&__pyx_n_s__new_step,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_step (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    values[2] = __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  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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__current_t);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__step_size);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_step", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __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 = 1897; __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 = 1897; __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 = 1897; __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 = 1897; __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":1897
 *             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":1924
 *         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 = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

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

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

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

  /* "pyfmi\fmi.pyx":1931
 *         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":1933
 *         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 = 1933; __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":1936
 * 
 * 
 *     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":1941
 *         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 = 1941; __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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variables,&__pyx_n_s__order,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_output_derivatives (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variables);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__order);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_output_derivatives", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1943; __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 = 1943; __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 = 1943; __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 = 1943; __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":1943
 *         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;
  char *__pyx_t_15;
  fmi1_value_reference_t __pyx_t_16;
  long __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  size_t __pyx_t_19;
  size_t __pyx_t_20;
  size_t __pyx_t_21;
  size_t __pyx_t_22;
  PyArrayObject *__pyx_t_23 = 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":1964
 *         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":1965
 * 
 *         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":1967
 *         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":1968
 * 
 *         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 = 1968; __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 = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_94), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1968; __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 = 1968; __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 = 1968; __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 = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1970
 *             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_6 = ((PyObject *)((PyObject*)(&PyString_Type)));
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_variables, __pyx_t_6); 
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1971
 * 
 *         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":1972
 *         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 = 1972; __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 = 1972; __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 = 1972; __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 = 1972; __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 = 1972; __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 = 1972; __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 = 1972; __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 = 1972; __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 = 1972; __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 = 1972; __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 = 1972; __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 = 1972; __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 = 1972; __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 = 1972; __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":1973
 *             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 = 1973; __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 = 1973; __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 = 1973; __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 = 1973; __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 = 1973; __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 = 1973; __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 = 1973; __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 = 1973; __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 = 1973; __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 = 1973; __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 = 1973; __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":1974
 *             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 = PyBytes_AsString(__pyx_v_variables); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __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_15, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_17 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_17 >= __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 = 1974; __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_L4;
  }

  /* "pyfmi\fmi.pyx":1975
 *             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_7 = ((PyObject *)((PyObject*)(&PyList_Type)));
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_variables, __pyx_t_7); 
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  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 = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = ((PyObject *)((PyObject*)(&PyString_Type)));
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_TypeCheck(__pyx_t_7, __pyx_t_8); 
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":1976
 *             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_18 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_nref = __pyx_t_18;

    /* "pyfmi\fmi.pyx":1977
 *         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_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    { 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_8, __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 = 1977; __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 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __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 = 1977; __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_8, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __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_8)); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__flatten); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 1977; __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 = 1977; __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":1978
 *             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 = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __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 = 1978; __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 = 1978; __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 = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 1978; __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 = 1978; __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":1979
 *             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_19 = __pyx_v_nref;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
      __pyx_v_i = __pyx_t_20;

      /* "pyfmi\fmi.pyx":1980
 *             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 = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_15 = PyBytes_AsString(__pyx_t_6); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __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_15, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (unlikely(__pyx_t_21 >= (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 = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_16;

      /* "pyfmi\fmi.pyx":1981
 *             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_22 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (unlikely(__pyx_t_22 >= (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 = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi1_integer_t *, __pyx_pybuffernd_orders.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_orders.diminfo[0].strides) = __pyx_v_order;
    }
    goto __pyx_L4;
  }
  /*else*/ {

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

  /* "pyfmi\fmi.pyx":1985
 *             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 = 1985; __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 = 1985; __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 = 1985; __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 = 1985; __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 = 1985; __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 = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__float); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __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_5)); __pyx_t_5 = 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 = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_23 = ((PyArrayObject *)__pyx_t_7);
  {
    __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_23, &__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 = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_23 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "pyfmi\fmi.pyx":1987
 *         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":1989
 *         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":1990
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_98), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":1992
 *             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":1994
 *         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":2008
 *             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 = 2008; __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_17set_input_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_16set_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_17set_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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variables,&__pyx_n_s__values,&__pyx_n_s__orders,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_derivatives (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variables);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__orders);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2012; __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 = 2012; __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 = 2012; __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_16set_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":2012
 *     types_platform = property(fget=_get_types_platform)
 * 
 *     def set_input_derivatives(self, variables, values, orders):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the input derivative order for the specified variables.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_16set_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;
  char *__pyx_t_16;
  fmi1_value_reference_t __pyx_t_17;
  long __pyx_t_18;
  int __pyx_t_19;
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_input_derivatives", 0);
  __Pyx_INCREF(__pyx_v_orders);
  __pyx_pybuffer_np_orders.pybuffer.buf = NULL;
  __pyx_pybuffer_np_orders.refcount = 0;
  __pyx_pybuffernd_np_orders.data = NULL;
  __pyx_pybuffernd_np_orders.rcbuffer = &__pyx_pybuffer_np_orders;
  __pyx_pybuffer_value_refs.pybuffer.buf = NULL;
  __pyx_pybuffer_value_refs.refcount = 0;
  __pyx_pybuffernd_value_refs.data = NULL;
  __pyx_pybuffernd_value_refs.rcbuffer = &__pyx_pybuffer_value_refs;
  __pyx_pybuffer_val.pybuffer.buf = NULL;
  __pyx_pybuffer_val.refcount = 0;
  __pyx_pybuffernd_val.data = NULL;
  __pyx_pybuffernd_val.rcbuffer = &__pyx_pybuffer_val;

  /* "pyfmi\fmi.pyx":2030
 *         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 = 2030; __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 = 2030; __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 = 2030; __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 = 2030; __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 = 2030; __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 = 2030; __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 = 2030; __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 = 2030; __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 = 2030; __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 = 2030; __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 = 2030; __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 = 2030; __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 = 2030; __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":2032
 *         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 = 2032; __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 = 2032; __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 = 2032; __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 = 2032; __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 = 2032; __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 = 2032; __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 = 2032; __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 = 2032; __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 = 2032; __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 = 2032; __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 = 2032; __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 = 2032; __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 = 2032; __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":2034
 *         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 = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":2035
 * 
 *         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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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 = 2035; __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":2037
 *         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 = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = (__pyx_v_nref != __pyx_t_8);
  if (__pyx_t_9) {

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

  /* "pyfmi\fmi.pyx":2040
 *             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":2041
 * 
 *         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":2044
 *         #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 = 2044; __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 = 2044; __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 = 2044; __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 = 2044; __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 = 2044; __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;
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++;
    } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++;
    } 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 = 2044; __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":2045
 * 
 *         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 = 2045; __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); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __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 = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_9) {

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

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

  /* "pyfmi\fmi.pyx":2050
 *             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_4 = ((PyObject *)((PyObject*)(&PyString_Type)));
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_variables, __pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":2051
 * 
 *         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 = 2051; __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 = 2051; __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 = 2051; __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 = 2051; __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 = 2051; __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 = 2051; __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 = 2051; __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 = 2051; __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 = 2051; __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 = 2051; __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 = 2051; __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 = 2051; __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 = 2051; __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 = 2051; __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":2052
 *         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 = PyBytes_AsString(__pyx_v_variables); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_17 = ((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_16, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_18 = 0;
    __pyx_t_12 = -1;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_12 = 0;
    } else if (unlikely(__pyx_t_18 >= __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 = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_17;
    goto __pyx_L8;
  }

  /* "pyfmi\fmi.pyx":2053
 *             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_3 = ((PyObject *)((PyObject*)(&PyList_Type)));
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_variables, __pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  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 = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = ((PyObject *)((PyObject*)(&PyString_Type)));
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_19 = __Pyx_TypeCheck(__pyx_t_3, __pyx_t_4); 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_20 = __pyx_t_19;
  } else {
    __pyx_t_20 = __pyx_t_9;
  }
  if (__pyx_t_20) {

    /* "pyfmi\fmi.pyx":2054
 *             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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __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 = 2054; __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 = 2054; __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 = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __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 = 2054; __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_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __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_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = 2054; __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 = 2054; __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":2055
 *         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 = 2055; __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 = 2055; __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_range, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_4)) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++;
      } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_4)) {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++;
      } else {
        __pyx_t_1 = __pyx_t_10(__pyx_t_4);
        if (unlikely(!__pyx_t_1)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __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":2056
 *             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 = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_16 = PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_17 = ((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_16, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_t_17); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; __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 = 2056; __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_L8;
  }
  /*else*/ {

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

  /* "pyfmi\fmi.pyx":2060
 *             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":2062
 *         status = FMIL.fmi1_import_set_real_input_derivatives(self._fmu, <FMIL.fmi1_value_reference_t*>value_refs.data, nref, <FMIL.fmi1_integer_t*>np_orders.data, <FMIL.fmi1_real_t*>val.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Real input derivatives.')
 * 
 */
  __pyx_t_20 = (__pyx_v_status != 0);
  if (__pyx_t_20) {

    /* "pyfmi\fmi.pyx":2063
 * 
 *         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 = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __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 = 2063; __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_19simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_18simulate[] = "\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_19simulate(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;
  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 *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 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":2068
 *                  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_108;
    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 = 2065; __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 = 2065; __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_18simulate(((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":2065
 *             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_18simulate(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
  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("simulate", 0);
  __Pyx_INCREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);

  /* "pyfmi\fmi.pyx":2128
 *             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 = __Pyx_PyString_Equals(__pyx_v_start_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2129
 *         """
 *         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_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_109); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __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 = 2129; __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_start_time);
    __pyx_v_start_time = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2130
 *         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 = __Pyx_PyString_Equals(__pyx_v_final_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2131
 *             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_110); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2131; __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 = 2131; __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_final_time);
    __pyx_v_final_time = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2133
 *             final_time = self.get_default_experiment_stop_time()
 * 
 *         return self._exec_simulate_algorithm(start_time,             # <<<<<<<<<<<<<<
 *                                              final_time,
 *                                              input,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_111); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyfmi\fmi.pyx":2138
 *                                              '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 = 2133; __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_112));
  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_kp_s_112));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_112));
  __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_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __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;

  __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.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_21simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_20simulate_options[] = "\n        Get an instance of the simulate options class, prefilled 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_21simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__algorithm,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 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 = 2140; __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 = 2140; __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_20simulate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_algorithm);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2140
 *                                              options)
 * 
 *     def simulate_options(self, algorithm='FMICSAlg'):             # <<<<<<<<<<<<<<
 *         """
 *         Get an instance of the simulate options class, prefilled with default
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_20simulate_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":2157
 *             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 = 2157; __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 = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_112));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_112));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_112));
  __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 = 2157; __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_23initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_22initialize[] = "\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_23initialize(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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__tStart,&__pyx_n_s__tStop,&__pyx_n_s__StopTimeDefined,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    values[0] = __pyx_k_113;
    values[1] = __pyx_k_114;
    values[2] = __pyx_k_115;
    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 = 2159; __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 = 2159; __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_22initialize(((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":2159
 *         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_22initialize(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":2172
 *         """
 *         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 = 2172; __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":2174
 *         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 = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":2176
 *         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 = 2176; __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 = 2176; __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":2178
 *         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":2179
 * 
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("The slave failed to initialize. See the log for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *         self._allocated_fmu = True
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_117), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2179; __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 = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2181
 *             raise FMUException("The slave failed to initialize. See the log for possibly more information.")
 * 
 *         self._allocated_fmu = True             # <<<<<<<<<<<<<<
 * 
 *     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_25reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_24reset[] = "\n        This metod resets the FMU according to the reset method defined\n        in the FMI1 specification.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_25reset(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_24reset(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2183
 *         self._allocated_fmu = True
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         This metod resets the FMU according to the reset method defined
 */

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

  /* "pyfmi\fmi.pyx":2194
 * 
 *         #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":2197
 * 
 *         #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 = 2197; __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":2198
 *         #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":2199
 *         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 = 2199; __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 = __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_27instantiate_slave(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_26instantiate_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_27instantiate_slave(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_logging = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__logging,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instantiate_slave (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s__Slave);
    values[1] = __pyx_k_120;
    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 = 2202; __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 = 2202; __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_26instantiate_slave(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_name, __pyx_v_logging);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2202
 * 
 * 
 *     def instantiate_slave(self, name='Slave', logging=False):             # <<<<<<<<<<<<<<
 *         """
 *         Instantiate the slave.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_26instantiate_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;
  fmi1_string_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  fmi1_string_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("instantiate_slave", 0);

  /* "pyfmi\fmi.pyx":2219
 *         """
 *         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 = 2219; __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":2220
 *         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":2221
 *         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":2222
 *         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":2223
 *         cdef FMIL.fmi1_boolean_t visible = 0
 *         cdef FMIL.fmi1_boolean_t interactive = 0
 *         cdef FMIL.fmi1_string_t location = NULL             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_instantiate_slave(self._fmu, name, location,
 */
  __pyx_v_location = NULL;

  /* "pyfmi\fmi.pyx":2225
 *         cdef FMIL.fmi1_string_t location = NULL
 * 
 *         status = FMIL.fmi1_import_instantiate_slave(self._fmu, name, location,             # <<<<<<<<<<<<<<
 *                                         FMI_MIME_CS_STANDALONE, timeout, visible,
 *                                         interactive)
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_name); if (unlikely((__pyx_t_3 == (fmi1_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":2226
 * 
 *         status = FMIL.fmi1_import_instantiate_slave(self._fmu, name, location,
 *                                         FMI_MIME_CS_STANDALONE, timeout, visible,             # <<<<<<<<<<<<<<
 *                                         interactive)
 * 
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s_121); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyBytes_AsString(__pyx_t_4); if (unlikely((__pyx_t_5 == (fmi1_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2227
 *         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_3, __pyx_v_location, __pyx_t_5, __pyx_v_timeout, __pyx_v_visible, __pyx_v_interactive);

  /* "pyfmi\fmi.pyx":2229
 *                                         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":2230
 * 
 *         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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_123), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2234
 *         #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":2236
 *         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":2237
 * 
 *         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_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_125), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 2237; __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_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.instantiate_slave", __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_29get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_28get_capability_flags[] = "\n        Returns a dictionary with the cability 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_29get_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_28get_capability_flags(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2239
 *             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 cability flags of the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_28get_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":2255
 *             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 = 2255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_capabilities = __pyx_t_1;
  __pyx_t_1 = 0;

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

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

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

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

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

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

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

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

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

  /* "pyfmi\fmi.pyx":2270
 *         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;
  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};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_13);

    /* "pyfmi\fmi.pyx":2277
 *     """
 * 
 *     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_6);
    values[4] = __pyx_k_132;
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[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 = 2277; __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 = 2277; __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":2279
 *     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 = 2279; __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 = 2279; __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 = 2279; __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":2281
 *         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 = 2281; __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 = 2281; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __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 = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":2284
 *             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 = 2284; __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 = 2284; __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 = 2284; __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 = 2284; __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":2286
 *         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":2300
 *             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 = 2300; __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 reloades the DLL and finally\n        reinstantiates 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":2304
 *     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":2310
 *         reinstantiates 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":2311
 *         """
 *         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":2312
 *         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":2314
 *             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":2315
 * 
 *         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":2318
 * 
 *         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_31); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_status = fmi1_import_create_dllfmu(__pyx_v_self->__pyx_base._fmu, __pyx_v_self->__pyx_base.callBackFunctions, __pyx_t_3);

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

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

  /* "pyfmi\fmi.pyx":2324
 * 
 *         #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":2327
 * 
 *         #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 = 2327; __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":2328
 *         #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":2329
 *         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 = 2329; __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 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2332
 * 
 *         #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 = 2332; __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 = 2332; __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 = 2332; __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 = 2332; __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":2335
 * 
 * 
 *     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":2339
 *         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":2340
 *         """
 *         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":2341
 *         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":2343
 *             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":2344
 * 
 *         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":2346
 *             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":2347
 * 
 *         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":2349
 *             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":2350
 * 
 *         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":2351
 *         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":2352
 *             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":2354
 *             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":2355
 * 
 *         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":2357
 *             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":2358
 * 
 *         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":2359
 *         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":2361
 *             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 overriden 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 = 2361; __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 = 2361; __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":2362
 * 
 *     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":2361
 *             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 = 2361; __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":2364
 *         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 overriden 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 = 2364; __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 = 2364; __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 = 2364; __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 = 2364; __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":2366
 *     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 = 2366; __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":2368
 *         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":2370
 *         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":2371
 * 
 *         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 = 2371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_138), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2371; __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 = 2371; __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 = 2364; __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":2364
 *         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 = 2364; __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":2379
 *     """)
 * 
 *     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":2381
 *     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 = 2381; __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 = 2381; __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 = 2381; __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 = 2381; __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 = 2381; __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 = 2381; __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 = 2381; __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 = 2381; __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 = 2381; __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 = 2381; __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 = 2381; __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":2382
 *         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":2384
 *         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":2385
 * 
 *         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 = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_140), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __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 = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2387
 *             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 = 2389; __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":2389
 *         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 = 2389; __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":2391
 *     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 = 2391; __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":2393
 *         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 = 2393; __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 = 2393; __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); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; __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_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":2399
 *                 '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":2401
 *         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":2402
 * 
 *         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 = 2402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_144), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2402; __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 = 2402; __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":2411
 *     """)
 * 
 *     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":2413
 *     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 = 2413; __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 = 2413; __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 = 2413; __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 = 2413; __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 = 2413; __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 = 2413; __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 = 2413; __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 = 2413; __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 = 2413; __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 = 2413; __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 = 2413; __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":2416
 * 
 *         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":2418
 *                 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":2419
 * 
 *         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 = 2419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_146), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; __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 = 2419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2421
 *             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":2429
 *     """)
 * 
 *     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 overriden 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 = 2429; __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 = 2429; __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":2445
 *         """
 *         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 = 2445; __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 = 2445; __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 = 2445; __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 = 2445; __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 = 2445; __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 = 2445; __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 = 2445; __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 = 2445; __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 = 2445; __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 = 2445; __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 = 2445; __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":2447
 *         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":2449
 *         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.')
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2450
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the derivative values.')             # <<<<<<<<<<<<<<
 * 
 *         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 = 2450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_148), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2450; __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 = 2450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2452
 *             raise FMUException('Failed to get the derivative values.')
 * 
 *         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":2429
 *     """)
 * 
 *     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 = 2429; __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":2454
 *         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":2470
 *         """
 *         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 = 2470; __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 = 2470; __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 = 2470; __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 = 2470; __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 = 2470; __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 = 2470; __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 = 2470; __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 = 2470; __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 = 2470; __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 = 2470; __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 = 2470; __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":2472
 *         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":2474
 *         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":2475
 * 
 *         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 = 2475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_150), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2475; __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 = 2475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2477
 *             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":2480
 * 
 * 
 *     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":2501
 *         """
 *         #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_151); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; __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 = 2501; __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":2502
 *         #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 = 2502; __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 = 2502; __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_152); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; __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 = 2502; __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":2504
 *         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 = 2504; __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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__intermediateResult,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("event_update (wrapper)", 0);
  {
    PyObject* values[1] = {0};
    values[0] = __pyx_k_153;
    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 = 2506; __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 = 2506; __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":2506
 *         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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("event_update", 0);

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

    /* "pyfmi\fmi.pyx":2530
 * 
 *         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":2531
 *         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":2533
 *             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":2534
 *         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":2536
 *             status = FMIL.fmi1_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to update the events.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2537
 * 
 *         if status != 0:
 *             raise FMUException('Failed to update the events.')             # <<<<<<<<<<<<<<
 * 
 *     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 = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_155), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __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 = 2537; __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.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":2539
 *             raise FMUException('Failed to update the events.')
 * 
 *     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":2571
 *         """
 * 
 *         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 = 2571; __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 = 2571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

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

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

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

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

  /* "pyfmi\fmi.pyx":2578
 *         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":2580
 *         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":2596
 *         """
 *         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 = 2596; __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 = 2596; __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 = 2596; __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 = 2596; __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 = 2596; __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 = 2596; __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 = 2596; __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 = 2596; __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 = 2596; __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 = 2596; __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 = 2596; __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":2599
 * 
 *         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":2601
 *             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":2602
 * 
 *         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 = 2602; __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 = 2602; __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 = 2602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2605
 *                 '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":2607
 *         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":2623
 *         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":2625
 *         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":2626
 * 
 *         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 = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_160), NULL); 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);
    __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 = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2628
 *             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":2629
 * 
 *         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 = 2629; __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":2631
 *             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 = 2631; __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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__tolControlled,&__pyx_n_s__relativeTolerance,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    values[0] = __pyx_k_161;

    /* "pyfmi\fmi.pyx":2634
 * 
 * 
 *     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 = 2634; __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 = 2634; __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":2656
 * 
 *         #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 = 2656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

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

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

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

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

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

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

      /* "pyfmi\fmi.pyx":2673
 *         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 = 2673; __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 = 2673; __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_163), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2673; __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":2677
 *                     ' 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 = 2677; __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 = 2677; __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_165), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2677; __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":2680
 *                     ' 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":2681
 * 
 *         if status > 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException(
 *                     'Initialize returned with a 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 = 2681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":2682
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with a 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 = 2682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_167), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2682; __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 = 2682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":2686
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Initialize returned with a 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 = 2686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_169), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2686; __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 = 2686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L9:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":2689
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 *         self._allocated_fmu = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__logging,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instantiate_model (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s__Model);
    values[1] = __pyx_k_170;
    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 = 2692; __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 = 2692; __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":2692
 * 
 * 
 *     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;
  fmi1_string_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("instantiate_model", 0);

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

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

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

  /* "pyfmi\fmi.pyx":2716
 *             log = 0
 * 
 *         status = FMIL.fmi1_import_instantiate_model(self._fmu, name)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_t_2 = PyBytes_AsString(__pyx_v_name); if (unlikely((__pyx_t_2 == (fmi1_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_status = fmi1_import_instantiate_model(__pyx_v_self->__pyx_base._fmu, __pyx_t_2);

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

  /* "pyfmi\fmi.pyx":2723
 *         #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":2725
 *         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":2726
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_173), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2726; __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 = 2726; __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_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.instantiate_model", __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_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;
  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 *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 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":2731
 *                  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_174;
    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 = 2728; __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 = 2728; __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":2728
 *             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
  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("simulate", 0);
  __Pyx_INCREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);

  /* "pyfmi\fmi.pyx":2795
 *             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 = __Pyx_PyString_Equals(__pyx_v_start_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2796
 *         """
 *         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_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_109); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2796; __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 = 2796; __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_start_time);
    __pyx_v_start_time = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2797
 *         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 = __Pyx_PyString_Equals(__pyx_v_final_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2798
 *             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_110); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2798; __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 = 2798; __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_final_time);
    __pyx_v_final_time = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2800
 *             final_time = self.get_default_experiment_stop_time()
 * 
 *         return self._exec_simulate_algorithm(start_time,             # <<<<<<<<<<<<<<
 *                                              final_time,
 *                                              input,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_111); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyfmi\fmi.pyx":2805
 *                                              '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 = 2800; __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_112));
  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_kp_s_112));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_112));
  __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_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; __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;

  __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.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, prefilled 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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__algorithm,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 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 = 2807; __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 = 2807; __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":2807
 *                                              options)
 * 
 *     def simulate_options(self, algorithm='AssimuloFMIAlg'):             # <<<<<<<<<<<<<<
 *         """
 *         Get an instance of the simulate options class, prefilled 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":2824
 *             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 = 2824; __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 = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_112));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_112));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_112));
  __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 = 2824; __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":2826
 *         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":2831
 *         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        ";
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_13FMUModelBase2___init__;
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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,&__pyx_n_s__log_file_name,0};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_13);
    values[2] = __pyx_k_175;
    values[3] = ((PyObject *)__pyx_kp_s_6);
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[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, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __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("__init__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2839
 *     FMI Model loaded from a dll.
 *     """
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = ""):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */

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) {
  int __pyx_v_status;
  jm_string __pyx_v_last_error;
  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;
  jm_log_level_enu_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  char *__pyx_t_8;
  char *__pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16 = NULL;
  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);

  /* "pyfmi\fmi.pyx":2872
 * 
 *         #Contains the log information
 *         self._log               = []             # <<<<<<<<<<<<<<
 *         self._enable_logging    = enable_logging
 *         self._fmu_log_name      = ""
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2872; __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 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2873
 *         #Contains the log information
 *         self._log               = []
 *         self._enable_logging    = enable_logging             # <<<<<<<<<<<<<<
 *         self._fmu_log_name      = ""
 *         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":2874
 *         self._log               = []
 *         self._enable_logging    = enable_logging
 *         self._fmu_log_name      = ""             # <<<<<<<<<<<<<<
 *         self._categories        = []
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
  __Pyx_GOTREF(__pyx_v_self->_fmu_log_name);
  __Pyx_DECREF(__pyx_v_self->_fmu_log_name);
  __pyx_v_self->_fmu_log_name = ((PyObject *)__pyx_kp_s_6);

  /* "pyfmi\fmi.pyx":2875
 *         self._enable_logging    = enable_logging
 *         self._fmu_log_name      = ""
 *         self._categories        = []             # <<<<<<<<<<<<<<
 * 
 *         #Used for deallocation
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; __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 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2878
 * 
 *         #Used for deallocation
 *         self._allocated_context = False             # <<<<<<<<<<<<<<
 *         self._allocated_xml     = False
 *         self._allocated_dll     = False
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_allocated_context);
  __Pyx_DECREF(__pyx_v_self->_allocated_context);
  __pyx_v_self->_allocated_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2879
 *         #Used for deallocation
 *         self._allocated_context = False
 *         self._allocated_xml     = False             # <<<<<<<<<<<<<<
 *         self._allocated_dll     = False
 *         self._allocated_fmu     = False
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_allocated_xml);
  __Pyx_DECREF(__pyx_v_self->_allocated_xml);
  __pyx_v_self->_allocated_xml = __pyx_t_1;
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":2882
 *         self._allocated_dll     = False
 *         self._allocated_fmu     = False
 *         self._fmu_temp_dir      = ""             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
  __Pyx_GOTREF(__pyx_v_self->_fmu_temp_dir);
  __Pyx_DECREF(__pyx_v_self->_fmu_temp_dir);
  __pyx_v_self->_fmu_temp_dir = ((PyObject *)__pyx_kp_s_6);

  /* "pyfmi\fmi.pyx":2886
 * 
 *         #Default values
 *         self.__t = None             # <<<<<<<<<<<<<<
 * 
 *         #Internal values
 */
  __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":2889
 * 
 *         #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 = 2889; __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 = 2889; __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":2892
 * 
 *         #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":2893
 *         #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":2894
 *         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":2895
 *         self.callbacks.calloc           = FMIL.calloc
 *         self.callbacks.realloc          = FMIL.realloc
 *         self.callbacks.free             = FMIL.free             # <<<<<<<<<<<<<<
 *         self.callbacks.logger           = importlogger2
 *         self.callbacks.log_level        = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error
 */
  __pyx_v_self->callbacks.free = free;

  /* "pyfmi\fmi.pyx":2896
 *         self.callbacks.realloc          = FMIL.realloc
 *         self.callbacks.free             = FMIL.free
 *         self.callbacks.logger           = importlogger2             # <<<<<<<<<<<<<<
 *         self.callbacks.log_level        = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error
 *         self.callbacks.context          = <void*> self
 */
  __pyx_v_self->callbacks.logger = __pyx_f_5pyfmi_3fmi_importlogger2;

  /* "pyfmi\fmi.pyx":2897
 *         self.callbacks.free             = FMIL.free
 *         self.callbacks.logger           = importlogger2
 *         self.callbacks.log_level        = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error             # <<<<<<<<<<<<<<
 *         self.callbacks.context          = <void*> self
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __pyx_t_3 = jm_log_level_info;
  } else {
    __pyx_t_3 = jm_log_level_error;
  }
  __pyx_v_self->callbacks.log_level = __pyx_t_3;

  /* "pyfmi\fmi.pyx":2898
 *         self.callbacks.logger           = importlogger2
 *         self.callbacks.log_level        = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error
 *         self.callbacks.context          = <void*> self             # <<<<<<<<<<<<<<
 * 
 *         #Specify FMI2 related callbacks
 */
  __pyx_v_self->callbacks.context = ((void *)__pyx_v_self);

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

  /* "pyfmi\fmi.pyx":2902
 *         #Specify FMI2 related callbacks
 *         self.callBackFunctions.logger               = FMIL.fmi2_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":2903
 *         self.callBackFunctions.logger               = FMIL.fmi2_log_forwarding
 *         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":2905
 *         self.callBackFunctions.freeMemory           = FMIL.free
 *         #self.callBackFunctions.stepFinished        = NULL
 *         self.callBackFunctions.componentEnvironment = NULL             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->callBackFunctions.componentEnvironment = NULL;

  /* "pyfmi\fmi.pyx":2909
 * 
 *         # Check that the file referenced by fmu has the correct file-ending
 *         self._fmu_full_path = os.path.abspath(os.path.join(path,fmu))             # <<<<<<<<<<<<<<
 *         if not self._fmu_full_path.endswith('.fmu'):
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __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 = 2909; __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__abspath); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __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_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __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_GetAttr(__pyx_t_5, __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __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_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2909; __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_5)); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_v_self->_fmu_full_path);
  __Pyx_DECREF(__pyx_v_self->_fmu_full_path);
  __pyx_v_self->_fmu_full_path = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pyfmi\fmi.pyx":2910
 *         # Check that the file referenced by fmu has the correct file-ending
 *         self._fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *         if not self._fmu_full_path.endswith('.fmu'):             # <<<<<<<<<<<<<<
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_t_6 = PyObject_GetAttr(__pyx_v_self->_fmu_full_path, __pyx_n_s__endswith); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_176), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = (!__pyx_t_4);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2911
 *         self._fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *         if not self._fmu_full_path.endswith('.fmu'):
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *         #Check that the file exists
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_177), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __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 = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2914
 * 
 *         #Check that the file exists
 *         if not os.path.isfile(self._fmu_full_path):             # <<<<<<<<<<<<<<
 *             raise FMUException('Could not locate the FMU in the specified directory.')
 * 
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__isfile); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_self->_fmu_full_path);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_fmu_full_path);
  __Pyx_GIVEREF(__pyx_v_self->_fmu_full_path);
  __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __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_5)); __pyx_t_5 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_7);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2915
 *         #Check that the file exists
 *         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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_179), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2915; __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 = 2915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2918
 * 
 *         # Create a struct for allocation
 *         self._context           = FMIL.fmi_import_allocate_context(&self.callbacks)             # <<<<<<<<<<<<<<
 *         self._allocated_context = True
 * 
 */
  __pyx_v_self->_context = fmi_import_allocate_context((&__pyx_v_self->callbacks));

  /* "pyfmi\fmi.pyx":2919
 *         # Create a struct for allocation
 *         self._context           = FMIL.fmi_import_allocate_context(&self.callbacks)
 *         self._allocated_context = True             # <<<<<<<<<<<<<<
 * 
 *         #Get the FMI version of the provided model
 */
  __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->_allocated_context);
  __Pyx_DECREF(__pyx_v_self->_allocated_context);
  __pyx_v_self->_allocated_context = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":2922
 * 
 *         #Get the FMI version of the provided model
 *         self._fmu_temp_dir = create_temp_dir()             # <<<<<<<<<<<<<<
 *         self._version      = FMIL.fmi_import_get_fmi_version(self._context, self._fmu_full_path, self._fmu_temp_dir)
 * 
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__create_temp_dir); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2922; __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 = 2922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_fmu_temp_dir);
  __Pyx_DECREF(__pyx_v_self->_fmu_temp_dir);
  __pyx_v_self->_fmu_temp_dir = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2923
 *         #Get the FMI version of the provided model
 *         self._fmu_temp_dir = create_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_8 = PyBytes_AsString(__pyx_v_self->_fmu_full_path); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = PyBytes_AsString(__pyx_v_self->_fmu_temp_dir); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_version = fmi_import_get_fmi_version(__pyx_v_self->_context, __pyx_t_8, __pyx_t_9);

  /* "pyfmi\fmi.pyx":2926
 * 
 *         #Check the version
 *         if self._version == FMIL.fmi_version_unknown_enu:             # <<<<<<<<<<<<<<
 *             last_error = FMIL.jm_get_last_error(&self.callbacks)
 *             if enable_logging:
 */
  __pyx_t_4 = (__pyx_v_self->_version == fmi_version_unknown_enu);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2927
 *         #Check the version
 *         if self._version == FMIL.fmi_version_unknown_enu:
 *             last_error = FMIL.jm_get_last_error(&self.callbacks)             # <<<<<<<<<<<<<<
 *             if enable_logging:
 *                 raise FMUException("The FMU version could not be determined. "+last_error)
 */
    __pyx_v_last_error = jm_get_last_error((&__pyx_v_self->callbacks));

    /* "pyfmi\fmi.pyx":2928
 *         if self._version == FMIL.fmi_version_unknown_enu:
 *             last_error = FMIL.jm_get_last_error(&self.callbacks)
 *             if enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The FMU version could not be determined. "+last_error)
 *             else:
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":2929
 *             last_error = 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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_kp_s_22), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __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 = 2929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2929; __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_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 = 2929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    /*else*/ {

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

  /* "pyfmi\fmi.pyx":2933
 *                 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 = FMIL.jm_get_last_error(&self.callbacks)
 *             if enable_logging:
 */
  __pyx_t_4 = (__pyx_v_self->_version != fmi_version_2_0_enu);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2934
 * 
 *         if self._version != FMIL.fmi_version_2_0_enu:
 *             last_error = FMIL.jm_get_last_error(&self.callbacks)             # <<<<<<<<<<<<<<
 *             if enable_logging:
 *                 raise FMUException("The FMU version is not supported by this class. "+last_error)
 */
    __pyx_v_last_error = jm_get_last_error((&__pyx_v_self->callbacks));

    /* "pyfmi\fmi.pyx":2935
 *         if self._version != FMIL.fmi_version_2_0_enu:
 *             last_error = 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_4 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":2936
 *             last_error = 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_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_181), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __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 = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2936; __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_6)); __pyx_t_6 = 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 = 2936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    /*else*/ {

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

  /* "pyfmi\fmi.pyx":2941
 * 
 *         #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_t_9 = PyBytes_AsString(__pyx_v_self->_fmu_temp_dir); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_fmu = fmi2_import_parse_xml(__pyx_v_self->_context, __pyx_t_9, NULL);

  /* "pyfmi\fmi.pyx":2943
 *         self._fmu           = FMIL.fmi2_import_parse_xml(self._context, self._fmu_temp_dir, NULL)
 * 
 *         if self._fmu is NULL:             # <<<<<<<<<<<<<<
 *             last_error = FMIL.jm_get_last_error(&self.callbacks)
 *             if enable_logging:
 */
  __pyx_t_4 = (__pyx_v_self->_fmu == NULL);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2944
 * 
 *         if self._fmu is NULL:
 *             last_error = FMIL.jm_get_last_error(&self.callbacks)             # <<<<<<<<<<<<<<
 *             if enable_logging:
 *                 raise FMUException("The XML-could not be read. "+last_error)
 */
    __pyx_v_last_error = jm_get_last_error((&__pyx_v_self->callbacks));

    /* "pyfmi\fmi.pyx":2945
 *         if self._fmu is NULL:
 *             last_error = FMIL.jm_get_last_error(&self.callbacks)
 *             if enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The XML-could not be read. "+last_error)
 *             else:
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":2946
 *             last_error = 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_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_s_184), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __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 = 2946; __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_6, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2946; __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_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 = 2946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L10;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":2948
 *                 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_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_186), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 2948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L10:;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":2950
 *                 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._fmu_kind      = FMIL.fmi2_import_get_fmu_kind(self._fmu)
 *         self._allocated_xml = True
 */
  __pyx_v_self->callBackFunctions.componentEnvironment = ((fmi2_component_environment_t)__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":2951
 * 
 *         self.callBackFunctions.componentEnvironment = <FMIL.fmi2_component_environment_t>self._fmu
 *         self._fmu_kind      = FMIL.fmi2_import_get_fmu_kind(self._fmu)             # <<<<<<<<<<<<<<
 *         self._allocated_xml = True
 * 
 */
  __pyx_v_self->_fmu_kind = fmi2_import_get_fmu_kind(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":2952
 *         self.callBackFunctions.componentEnvironment = <FMIL.fmi2_component_environment_t>self._fmu
 *         self._fmu_kind      = FMIL.fmi2_import_get_fmu_kind(self._fmu)
 *         self._allocated_xml = True             # <<<<<<<<<<<<<<
 * 
 *         #FMU kind is unknown
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_allocated_xml);
  __Pyx_DECREF(__pyx_v_self->_allocated_xml);
  __pyx_v_self->_allocated_xml = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2955
 * 
 *         #FMU kind is unknown
 *         if self._fmu_kind == FMIL.fmi2_fmu_kind_unknown:             # <<<<<<<<<<<<<<
 *             last_error = FMIL.jm_get_last_error(&self.callbacks)
 *             if enable_logging:
 */
  __pyx_t_4 = (__pyx_v_self->_fmu_kind == fmi2_fmu_kind_unknown);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2956
 *         #FMU kind is unknown
 *         if self._fmu_kind == FMIL.fmi2_fmu_kind_unknown:
 *             last_error = FMIL.jm_get_last_error(&self.callbacks)             # <<<<<<<<<<<<<<
 *             if enable_logging:
 *                 raise FMUException("The FMU kind could not be determined. "+last_error)
 */
    __pyx_v_last_error = jm_get_last_error((&__pyx_v_self->callbacks));

    /* "pyfmi\fmi.pyx":2957
 *         if self._fmu_kind == FMIL.fmi2_fmu_kind_unknown:
 *             last_error = FMIL.jm_get_last_error(&self.callbacks)
 *             if enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The FMU kind could not be determined. "+last_error)
 *             else:
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":2958
 *             last_error = 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 = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_kp_s_187), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __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 = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __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_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 = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L12;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":2960
 *                 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_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_189), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2960; __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 = 2960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L12:;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "pyfmi\fmi.pyx":2964
 * 
 *         #Connect the DLL
 *         status = FMIL.fmi2_import_create_dllfmu(self._fmu, self._fmu_kind, &self.callBackFunctions)             # <<<<<<<<<<<<<<
 *         if status == FMIL.jm_status_error:
 *             last_error = 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":2965
 *         #Connect the DLL
 *         status = FMIL.fmi2_import_create_dllfmu(self._fmu, self._fmu_kind, &self.callBackFunctions)
 *         if status == FMIL.jm_status_error:             # <<<<<<<<<<<<<<
 *             last_error = FMIL.fmi2_import_get_last_error(self._fmu)
 *             if enable_logging:
 */
  __pyx_t_4 = (__pyx_v_status == jm_status_error);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2966
 *         status = FMIL.fmi2_import_create_dllfmu(self._fmu, self._fmu_kind, &self.callBackFunctions)
 *         if status == FMIL.jm_status_error:
 *             last_error = FMIL.fmi2_import_get_last_error(self._fmu)             # <<<<<<<<<<<<<<
 *             if enable_logging:
 *                 raise FMUException(last_error)
 */
    __pyx_v_last_error = fmi2_import_get_last_error(__pyx_v_self->_fmu);

    /* "pyfmi\fmi.pyx":2967
 *         if status == FMIL.jm_status_error:
 *             last_error = FMIL.fmi2_import_get_last_error(self._fmu)
 *             if enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException(last_error)
 *             else:
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":2968
 *             last_error = FMIL.fmi2_import_get_last_error(self._fmu)
 *             if enable_logging:
 *                 raise FMUException(last_error)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")
 */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_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 = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":2970
 *                 raise FMUException(last_error)
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         self._allocated_dll = True
 * 
 */
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_190), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 2970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L14:;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pyfmi\fmi.pyx":2971
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")
 *         self._allocated_dll = True             # <<<<<<<<<<<<<<
 * 
 *         #Load information from model
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_allocated_dll);
  __Pyx_DECREF(__pyx_v_self->_allocated_dll);
  __pyx_v_self->_allocated_dll = __pyx_t_2;
  __pyx_t_2 = 0;

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

  /* "pyfmi\fmi.pyx":2975
 *         #Load information from model
 *         self._modelName         = 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._fmu_log_name      = (self._modelName + "_log.txt") if log_file_name=="" else log_file_name
 */
  __pyx_v_self->_nEventIndicators = fmi2_import_get_number_of_event_indicators(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":2976
 *         self._modelName         = 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._fmu_log_name      = (self._modelName + "_log.txt") if log_file_name=="" else log_file_name
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)
 */
  __pyx_v_self->_nContinuousStates = fmi2_import_get_number_of_continuous_states(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":2977
 *         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._fmu_log_name      = (self._modelName + "_log.txt") if log_file_name=="" else log_file_name             # <<<<<<<<<<<<<<
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)
 * 
 */
  __pyx_t_4 = __Pyx_PyString_Equals(__pyx_v_log_file_name, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __pyx_t_6 = PyNumber_Add(__pyx_v_self->_modelName, ((PyObject *)__pyx_kp_s_34)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2977; __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_log_file_name);
    __pyx_t_2 = __pyx_v_log_file_name;
  }
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_fmu_log_name);
  __Pyx_DECREF(__pyx_v_self->_fmu_log_name);
  __pyx_v_self->_fmu_log_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2978
 *         self._nContinuousStates = FMIL.fmi2_import_get_number_of_continuous_states(self._fmu)
 *         self._fmu_log_name      = (self._modelName + "_log.txt") if log_file_name=="" else log_file_name
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         #Create the log file
 */
  __pyx_v_self->_nCategories = fmi2_import_get_log_categories_num(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":2981
 * 
 *         #Create the log file
 *         with open(self._fmu_log_name,'w') as file:             # <<<<<<<<<<<<<<
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 */
  /*with:*/ {
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_self->_fmu_log_name);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->_fmu_log_name);
    __Pyx_GIVEREF(__pyx_v_self->_fmu_log_name);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__w));
    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w));
    __pyx_t_6 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_10 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s____exit__); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L15_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 = 2981; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    /*try:*/ {
      {
        __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        /*try:*/ {
          __Pyx_INCREF(__pyx_t_5);
          __pyx_v_file = __pyx_t_5;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "pyfmi\fmi.pyx":2982
 *         #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_5 = ((PyObject *)__pyx_v_self->_log);
          __Pyx_INCREF(__pyx_t_5);
          if (unlikely(__pyx_t_5 == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2982; __pyx_clineno = __LINE__; goto __pyx_L19_error;} 
          }
          __pyx_t_14 = PyList_GET_SIZE(__pyx_t_5); 
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2982; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2982; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_5 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2982; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
          if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
            __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_14 = 0;
            __pyx_t_15 = NULL;
          } else {
            __pyx_t_14 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2982; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_15 = Py_TYPE(__pyx_t_6)->tp_iternext;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          for (;;) {
            if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_6)) {
              if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_6)) break;
              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++;
            } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_6)) {
              if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++;
            } else {
              __pyx_t_5 = __pyx_t_15(__pyx_t_6);
              if (unlikely(!__pyx_t_5)) {
                if (PyErr_Occurred()) {
                  if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                  else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2982; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_5);
            }
            __Pyx_XDECREF(__pyx_v_i);
            __pyx_v_i = __pyx_t_5;
            __pyx_t_5 = 0;

            /* "pyfmi\fmi.pyx":2983
 *         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_5 = PyObject_GetAttr(__pyx_v_file, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self->_log), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self->_log), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self->_log), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_2, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_16);
            __Pyx_GIVEREF(__pyx_t_16);
            PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_17);
            __Pyx_GIVEREF(__pyx_t_17);
            __pyx_t_1 = 0;
            __pyx_t_16 = 0;
            __pyx_t_17 = 0;
            __pyx_t_17 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_17));
            __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 = 2983; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_17));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_17));
            __pyx_t_17 = 0;
            __pyx_t_17 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "pyfmi\fmi.pyx":2984
 *             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_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2984; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
          __Pyx_GOTREF(__pyx_v_self->_log);
          __Pyx_DECREF(((PyObject *)__pyx_v_self->_log));
          __pyx_v_self->_log = __pyx_t_6;
          __pyx_t_6 = 0;
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L26_try_end;
        __pyx_L19_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "pyfmi\fmi.pyx":2981
 * 
 *         #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_6, &__pyx_t_17, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_17);
          PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_17);
          __Pyx_GIVEREF(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_18 = PyObject_Call(__pyx_t_10, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __pyx_t_7 = (!__pyx_t_4);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_17);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_ErrRestore(__pyx_t_6, __pyx_t_17, __pyx_t_2);
            __pyx_t_6 = 0; __pyx_t_17 = 0; __pyx_t_2 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
            goto __pyx_L32;
          }
          __pyx_L32:;
          __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L20_exception_handled;
        }
        __pyx_L21_except_error:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        goto __pyx_L1_error;
        __pyx_L20_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        __pyx_L26_try_end:;
      }
    }
    /*finally:*/ {
      if (__pyx_t_10) {
        __pyx_t_13 = PyObject_Call(__pyx_t_10, __pyx_k_tuple_191, NULL);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }
    goto __pyx_L33;
    __pyx_L15_error:;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_16);
  __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_file);
  __Pyx_XDECREF(__pyx_v_i);
  __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: fmiGetReal/fmiSetReal\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":2988
 * 
 * 
 *     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":3012
 *         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 = 3012; __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 = 3012; __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 = 3012; __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 = 3012; __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 = 3012; __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 = 3012; __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 = 3012; __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 = 3012; __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 = 3012; __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 = 3012; __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 = 3012; __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 = 3012; __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 = 3012; __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":3013
 * 
 *         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 = 3013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

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

  /* "pyfmi\fmi.pyx":3021
 *             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: fmiGetReal/fmiSetReal\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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_real (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_real", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __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 = 3023; __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 = 3023; __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":3023
 *         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":3044
 *         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 = 3044; __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 = 3044; __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 = 3044; __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 = 3044; __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 = 3044; __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 = 3044; __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 = 3044; __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 = 3044; __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 = 3044; __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 = 3044; __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 = 3044; __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 = 3044; __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 = 3044; __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":3045
 * 
 *         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 = 3045; __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 = 3045; __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 = 3045; __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 = 3045; __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 = 3045; __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 = 3045; __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 = 3045; __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 = 3045; __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 = 3045; __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 = 3045; __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 = 3045; __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 = 3045; __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 = 3045; __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":3047
 *         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 = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":3049
 *         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 = 3049; __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 = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_8 != __pyx_t_9);
  if (__pyx_t_10) {

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

  /* "pyfmi\fmi.pyx":3052
 *             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":3054
 *         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":3055
 * 
 *         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 = 3055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_194), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3055; __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 = 3055; __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: fmiGetInteger/fmiSetInteger\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":3057
 *             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":3080
 *         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 = 3080; __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 = 3080; __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 = 3080; __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 = 3080; __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 = 3080; __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 = 3080; __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 = 3080; __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 = 3080; __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 = 3080; __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 = 3080; __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 = 3080; __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 = 3080; __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 = 3080; __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":3081
 * 
 *         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 = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

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

  /* "pyfmi\fmi.pyx":3090
 *             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: fmiGetInteger/fmiSetInteger\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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_integer (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_integer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3092; __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 = 3092; __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 = 3092; __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":3092
 *         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":3113
 *         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 = 3113; __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 = 3113; __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 = 3113; __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 = 3113; __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 = 3113; __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 = 3113; __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 = 3113; __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 = 3113; __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 = 3113; __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 = 3113; __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 = 3113; __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 = 3113; __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 = 3113; __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":3114
 * 
 *         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 = 3114; __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 = 3114; __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 = 3114; __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 = 3114; __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 = 3114; __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 = 3114; __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 = 3114; __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 = 3114; __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 = 3114; __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 = 3114; __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 = 3114; __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 = 3114; __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":3116
 *         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 = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":3118
 *         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 = 3118; __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 = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_8 != __pyx_t_9);
  if (__pyx_t_10) {

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

  /* "pyfmi\fmi.pyx":3121
 *             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":3123
 *         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":3124
 * 
 *         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 = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_197), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3124; __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 = 3124; __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: fmiGetBoolean/fmiSetBoolean\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":3126
 *             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":3149
 *         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 = 3149; __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 = 3149; __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 = 3149; __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 = 3149; __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 = 3149; __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 = 3149; __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 = 3149; __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 = 3149; __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 = 3149; __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 = 3149; __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 = 3149; __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 = 3149; __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 = 3149; __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":3150
 * 
 *         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 = 3150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":3153
 * 
 *         #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":3157
 * 
 *         #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":3159
 *         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 = 3159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_return_values = __pyx_t_5;
  __pyx_t_5 = 0;

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

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

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

  /* "pyfmi\fmi.pyx":3173
 * 
 *         #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 = 3173; __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 = 3173; __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 = 3173; __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 = 3173; __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: fmiGetBoolean/fmiSetBoolean\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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_boolean (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_boolean", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __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 = 3175; __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 = 3175; __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":3175
 *         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":3196
 *         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 = 3196; __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 = 3196; __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 = 3196; __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 = 3196; __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 = 3196; __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 = 3196; __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 = 3196; __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 = 3196; __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 = 3196; __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 = 3196; __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 = 3196; __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 = 3196; __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 = 3196; __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":3197
 * 
 *         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 = 3197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

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

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

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

  /* "pyfmi\fmi.pyx":3215
 * 
 *         #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":3217
 *         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":3219
 *         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":3220
 * 
 *         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 = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_200), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __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 = 3220; __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: fmiGetString/fmiSetString\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":3222
 *             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":3243
 *         """
 * 
 *         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 = 3243; __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: fmiGetString/fmiSetString\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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_string (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_string", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __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 = 3259; __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 = 3259; __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":3259
 *         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":3277
 *         Calls the low-level FMI function: fmiGetString/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 = 3277; __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) {
  char *__pyx_v_variable_name;
  PyObject *__pyx_v_value = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variable_name,&__pyx_n_s__value,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variable_name);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __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 = 3294; __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 = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_variable_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __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 = 3294; __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":3294
 *             raise FMUException('Failed to set the String values.')
 * 
 *     def _set(self,char* 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, char *__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":3301
 *         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 = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ref = __pyx_t_1;

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

  /* "pyfmi\fmi.pyx":3304
 *         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":3305
 * 
 *         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 = 3305; __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 = 3305; __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 = 3305; __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 = 3305; __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 = 3305; __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 = 3305; __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":3306
 *         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":3307
 *             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 = 3307; __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 = 3307; __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 = 3307; __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 = 3307; __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 = 3307; __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 = 3307; __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":3308
 *         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":3309
 *             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 = 3309; __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 = 3309; __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 = 3309; __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 = 3309; __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 = 3309; __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 = 3309; __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":3310
 *         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":3311
 *             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 = 3311; __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 = 3311; __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 = 3311; __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 = 3311; __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 = 3311; __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 = 3311; __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":3313
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     def _get(self,char* 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 = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_201), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __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 = 3313; __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_arg_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_arg_variable_name) {
  char *__pyx_v_variable_name;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get (wrapper)", 0);
  assert(__pyx_arg_variable_name); {
    __pyx_v_variable_name = PyBytes_AsString(__pyx_arg_variable_name); if (unlikely((!__pyx_v_variable_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_20_get(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3315
 *             raise FMUException('Type not supported.')
 * 
 *     def _get(self,char* 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, char *__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":3322
 *         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 = 3322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ref = __pyx_t_1;

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

  /* "pyfmi\fmi.pyx":3325
 *         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":3326
 * 
 *         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 = 3326; __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 = 3326; __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 = 3326; __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 = 3326; __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 = 3326; __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":3327
 *         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":3328
 *             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 = 3328; __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 = 3328; __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 = 3328; __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 = 3328; __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 = 3328; __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":3329
 *         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":3330
 *             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 = 3330; __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 = 3330; __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 = 3330; __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 = 3330; __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 = 3330; __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":3331
 *         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":3332
 *             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 = 3332; __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 = 3332; __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 = 3332; __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 = 3332; __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 = 3332; __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":3334
 *             return self.get_boolean([ref])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_202), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3334; __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 = 3334; __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":3340
 * 
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message):             # <<<<<<<<<<<<<<
 *         #print "FMIL: module = %s, log level = %d: %s"%(module, log_level, message)
 *         if self._fmu_log_name != "":
 */

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":3342
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 *         #print "FMIL: module = %s, log level = %d: %s"%(module, log_level, message)
 *         if self._fmu_log_name != "":             # <<<<<<<<<<<<<<
 *             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_PyString_Equals(__pyx_v_self->_fmu_log_name, ((PyObject *)__pyx_kp_s_6), Py_NE); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3343
 *         #print "FMIL: module = %s, log level = %d: %s"%(module, log_level, message)
 *         if self._fmu_log_name != "":
 *             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 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_self->_fmu_log_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->_fmu_log_name);
      __Pyx_GIVEREF(__pyx_v_self->_fmu_log_name);
      __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_3 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __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 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __pyx_clineno = __LINE__; goto __pyx_L4_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 = 3343; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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":3344
 *         if self._fmu_log_name != "":
 *             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 = 3344; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_3 = PyBytes_FromString(__pyx_v_module); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_3));
            __pyx_t_2 = PyInt_FromLong(__pyx_v_log_level); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_9 = PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __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 = 3344; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_10);
            PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_3));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
            PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_t_9));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_9 = 0;
            __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __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 = 3344; __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 = 3344; __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_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 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":3343
 *         #print "FMIL: module = %s, log level = %d: %s"%(module, log_level, message)
 *         if self._fmu_log_name != "":
 *             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 = 3343; __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_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __pyx_clineno = __LINE__; goto __pyx_L10_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_10);
            PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_5);
            __pyx_t_11 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __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 = 3343; __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 = 3343; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
              goto __pyx_L19;
            }
            __pyx_L19:;
            __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 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_203, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __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 = 3343; __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":3346
 *                 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 = 3346; __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 = 3346; __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 = 3346; __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 = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_9));
    __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyList_SET_ITEM(__pyx_t_2, 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_2)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 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        FMUModelBase2(..., 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":3348
 *             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":3361
 *             log -- A list of lists.
 *         """
 *         log = []             # <<<<<<<<<<<<<<
 *         if self._fmu_log_name != "":
 *             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 = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_log = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3362
 *         """
 *         log = []
 *         if self._fmu_log_name != "":             # <<<<<<<<<<<<<<
 *             with open(self._fmu_log_name,'r') as file:
 *                 while True:
 */
  __pyx_t_2 = __Pyx_PyString_Equals(__pyx_v_self->_fmu_log_name, ((PyObject *)__pyx_kp_s_6), Py_NE); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3363
 *         log = []
 *         if self._fmu_log_name != "":
 *             with open(self._fmu_log_name,'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 = 3363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_self->_fmu_log_name);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_fmu_log_name);
      __Pyx_GIVEREF(__pyx_v_self->_fmu_log_name);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
      PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__r));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r));
      __pyx_t_3 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____enter__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __pyx_clineno = __LINE__; goto __pyx_L4_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 = 3363; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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":3364
 *         if self._fmu_log_name != "":
 *             with open(self._fmu_log_name,'r') as file:
 *                 while True:             # <<<<<<<<<<<<<<
 *                     line = file.readline()
 *                     if line == "":
 */
            while (1) {
              if (!1) break;

              /* "pyfmi\fmi.pyx":3365
 *             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 = 3365; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_v_line);
              __pyx_v_line = __pyx_t_3;
              __pyx_t_3 = 0;

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

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

          /* "pyfmi\fmi.pyx":3363
 *         log = []
 *         if self._fmu_log_name != "":
 *             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_3, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __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_3);
            PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            __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_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 = 3363; __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 = 3363; __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_3);
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_ErrRestore(__pyx_t_5, __pyx_t_3, __pyx_t_1);
              __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __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_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_205, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __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 = 3363; __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:;
    }

    /* "pyfmi\fmi.pyx":3369
 *                         break
 *                     log.append(line.strip("\n"))
 *             return log             # <<<<<<<<<<<<<<
 *         else:
 *             return self._log
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_log));
    __pyx_r = ((PyObject *)__pyx_v_log);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3371
 *             return log
 *         else:
 *             return self._log             # <<<<<<<<<<<<<<
 * 
 *     def print_log(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_self->_log));
    __pyx_r = ((PyObject *)__pyx_v_self->_log);
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_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":3373
 *             return self._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":3378
 *         """
 *         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 = 3378; __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 = 3378; __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":3379
 *         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 = 3379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_3;

  /* "pyfmi\fmi.pyx":3381
 *         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":3382
 * 
 *         for i in range(N):
 *             print log[i]             # <<<<<<<<<<<<<<
 * 
 *     def set_fmil_log_level(self, level):
 */
    __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 = 3382; __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 = 3382; __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_27set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_v_level); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_26set_fmil_log_level[] = "\n        Specifices the log level for FMI Library. Note that this is\n        different from the FMU logging which is specificed 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_27set_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_26set_fmil_log_level(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_level));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3384
 *             print log[i]
 * 
 *     def set_fmil_log_level(self, level):             # <<<<<<<<<<<<<<
 *         """
 *         Specifices the log level for FMI Library. Note that this is
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_26set_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":3403
 *                     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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __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 = 3403; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __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 = 3403; __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":3404
 *         """
 *         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 = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_206), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __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 = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3405
 *         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 = 3405; __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_29get_fmil_log_level(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_28get_fmil_log_level[] = "\n        Returns::\n\n            The current fmil log-level.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_29get_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_28get_fmil_log_level(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3407
 *         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_28get_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;
  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_fmil_log_level", 0);

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

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

    /* "pyfmi\fmi.pyx":3418
 *         if self._enable_logging:
 *             level = self.callbacks.log_level
 *             return level             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Logging is not enabled')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyInt_FromLong(__pyx_v_level); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3418; __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_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3420
 *             return level
 *         else:
 *             raise FMUException('Logging is not enabled')             # <<<<<<<<<<<<<<
 * 
 *     def set_debug_logging(self, logging_on, categories = []):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_208), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3420; __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 = 3420; __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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_31set_debug_logging(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_30set_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: fmiSetDebuggLogging\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_31set_debug_logging(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_logging_on = 0;
  PyObject *__pyx_v_categories = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__logging_on,&__pyx_n_s__categories,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_debug_logging (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_209;
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__logging_on);
        if (likely(values[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 = 3422; __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 = 3422; __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_30set_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":3422
 *             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_30set_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":3441
 *         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":3443
 *         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 = 3443; __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":3445
 *         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 = 3445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

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

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

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

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

  /* "pyfmi\fmi.pyx":3455
 *             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":3457
 *         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":3458
 * 
 *         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 = 3458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_212), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3458; __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 = 3458; __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_33get_categories(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_32get_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 avalible for logging.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_33get_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_32get_categories(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

    /* "pyfmi\fmi.pyx":3474
 *             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 = 3474; __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 = 3474; __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 = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3476
 *             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 = 3476; __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 = 3476; __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 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3478
 *             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_35get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_34get_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            variablename --\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_35get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variablename = 0;
  PyObject *__pyx_v_valueref = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variablename,&__pyx_n_s__valueref,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_nominal (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};

    /* "pyfmi\fmi.pyx":3483
 * 
 * 
 *     def get_variable_nominal(self, variablename=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__variablename);
          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 = 3483; __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_variablename = 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 = 3483; __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_34get_variable_nominal(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_variablename, __pyx_v_valueref);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_34get_variable_nominal(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variablename, PyObject *__pyx_v_valueref) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_real_variable_t *__pyx_v_real_variable;
  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);

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

    /* "pyfmi\fmi.pyx":3504
 * 
 *         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 = 3504; __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":3505
 *         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 variablename != None:
 */
    __pyx_t_2 = (__pyx_v_variable == NULL);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3506
 *             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 variablename != None:
 *             variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3506; __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 = 3506; __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 = 3506; __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_72), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3506; __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 = 3506; __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 = 3506; __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 = 3506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }

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

    /* "pyfmi\fmi.pyx":3508
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 *         elif variablename != None:
 *             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 = PyBytes_AsString(__pyx_v_variablename); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_t_6);

    /* "pyfmi\fmi.pyx":3509
 *         elif variablename != None:
 *             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":3510
 *             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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), __pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __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 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __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_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 = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L3;
  }
  /*else*/ {

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

  /* "pyfmi\fmi.pyx":3514
 *             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":3515
 * 
 *         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":3516
 *         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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_214), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_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 = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":3518
 *             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_5 = PyFloat_FromDouble(fmi2_import_get_real_variable_nominal(__pyx_v_real_variable)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_37get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_36get_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_37get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_type = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__type,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_by_valueref (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
        if (likely(values[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 = 3520; __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 = 3520; __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_36get_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":3520
 *         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_36get_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":3543
 *         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 = 3543; __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 = 3543; __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":3544
 * 
 *         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":3545
 *         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 = 3545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_88), __pyx_v_valueref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3545; __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 = 3545; __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 = 3545; __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 = 3545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3547
 *             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":3549
 *         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 = 3549; __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_39get_variable_alias_base(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_38get_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_39get_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 = 3551; __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_38get_variable_alias_base(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3551
 *         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_38get_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":3567
 *         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":3568
 * 
 *         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":3569
 *         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 = 3569; __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 = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3569; __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 = 3569; __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 = 3569; __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 = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

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

  /* "pyfmi\fmi.pyx":3575
 *             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":3577
 *         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 = 3577; __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_41get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_40get_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 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_13FMUModelBase2_41get_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 = 3579; __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_40get_variable_alias(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3579
 *         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_40get_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":3604
 *         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 = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_ret_values = __pyx_t_1;
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":3612
 *             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":3614
 *         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":3617
 * 
 *         #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":3619
 *         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":3621
 *             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":3622
 * 
 *             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":3624
 *             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 = 3624; __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 = 3624; __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 = 3624; __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":3627
 * 
 *         #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":3629
 *         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_43get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_42get_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_43get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filter = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filter,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_time_varying_value_references (wrapper)", 0);
  {
    PyObject* values[1] = {0};

    /* "pyfmi\fmi.pyx":3631
 *         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 = 3631; __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 = 3631; __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_42get_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_42get_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;
  char *__pyx_v_name;
  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;
  PyObject *__pyx_t_14 = 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":3657
 *         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 = 3657; __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":3658
 *         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":3659
 *         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 = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_real_var_ref = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":3660
 *         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 = 3660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_int_var_ref = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":3661
 *         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 = 3661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_bool_var_ref = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":3663
 *         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":3664
 * 
 *         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":3666
 *         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":3667
 * 
 *         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 = 3667; __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 = 3667; __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 = 3667; __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":3668
 *         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 = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_length_filter = __pyx_t_6;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3670
 *             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":3672
 *         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":3674
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 * 
 *             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_v_alias_kind = fmi2_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":3675
 * 
 *             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":3676
 *             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":3677
 *             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_data_type = fmi2_import_get_variable_base_type(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":3678
 *             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":3681
 * 
 * 
 *             if data_type != FMI2_REAL and data_type != FMI2_INTEGER and data_type != FMI2_BOOLEAN:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __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 = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_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 = 3681; __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(__pyx_v_data_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __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 = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_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 = 3681; __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_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_BOOLEAN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_11 = __pyx_t_10;
      } else {
        __pyx_t_11 = __pyx_t_9;
      }
      __pyx_t_9 = __pyx_t_11;
    } else {
      __pyx_t_9 = __pyx_t_2;
    }
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":3682
 * 
 *             if data_type != FMI2_REAL and data_type != FMI2_INTEGER and data_type != FMI2_BOOLEAN:
 *                 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":3684
 *                 continue
 * 
 *             if data_variability != FMI2_CONTINUOUS and data_variability != FMI2_DISCRETE and data_variability != FMI2_TUNABLE:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_CONTINUOUS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __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 = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_DISCRETE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_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 = 3684; __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(__pyx_v_data_variability); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_TUNABLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_10 = __pyx_t_11;
      } else {
        __pyx_t_10 = __pyx_t_2;
      }
      __pyx_t_2 = __pyx_t_10;
    } else {
      __pyx_t_2 = __pyx_t_9;
    }
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3685
 * 
 *             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":3687
 *                 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":3688
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     if re.match(filter_list[j], name):
 *                         break
 */
      __pyx_t_12 = __pyx_v_length_filter;
      for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
        __pyx_v_j = __pyx_t_13;

        /* "pyfmi\fmi.pyx":3689
 *             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 = 3689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__match); 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_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_v_filter_list)) { __Pyx_RaiseUnboundLocalError("filter_list"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3689; __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 = 3689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
        __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_14, 1, ((PyObject *)__pyx_t_3));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
        __pyx_t_5 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_14), NULL); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_2) {

          /* "pyfmi\fmi.pyx":3690
 *                 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":3692
 *                         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":3694
 *                     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":3695
 *             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":3697
 *                     continue
 * 
 *             if data_type == FMI2_REAL:             # <<<<<<<<<<<<<<
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI2_INTEGER:
 */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_REAL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_14, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3698
 * 
 *             if data_type == FMI2_REAL:
 *                 real_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 *             if data_type == FMI2_INTEGER:
 *                 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 = 3698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pyfmi\fmi.pyx":3699
 *             if data_type == FMI2_REAL:
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI2_INTEGER:             # <<<<<<<<<<<<<<
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI2_BOOLEAN:
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_INTEGER); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_14, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3699; __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_14); __pyx_t_14 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3700
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI2_INTEGER:
 *                 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 = 3700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    __pyx_L14:;

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

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

  /* "pyfmi\fmi.pyx":3705
 * 
 *         #Free the variable list
 *         FMIL.fmi2_import_free_variable_list(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         return real_var_ref.keys(), int_var_ref.keys(), bool_var_ref.keys()
 */
  fmi2_import_free_variable_list(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":3707
 *         FMIL.fmi2_import_free_variable_list(variable_list)
 * 
 *         return real_var_ref.keys(), int_var_ref.keys(), bool_var_ref.keys()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyDict_Keys(__pyx_v_real_var_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_14 = PyDict_Keys(__pyx_v_int_var_ref); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_3 = PyDict_Keys(__pyx_v_bool_var_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3707; __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);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_4 = 0;
  __pyx_t_14 = 0;
  __pyx_t_3 = 0;
  __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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_14);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_45get_model_variables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_44get_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_45get_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;
  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 *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_variables (wrapper)", 0);
  {
    PyObject* values[7] = {0,0,0,0,0,0,0};

    /* "pyfmi\fmi.pyx":3710
 * 
 * 
 *     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_215;

    /* "pyfmi\fmi.pyx":3711
 * 
 *     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_216;
    values[5] = __pyx_k_217;

    /* "pyfmi\fmi.pyx":3713
 *                              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 = 3710; __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 = 3710; __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_44get_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":3710
 * 
 * 
 *     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_44get_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;
  char *__pyx_v_desc;
  PyObject *__pyx_v_variable_dict = 0;
  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_filter_list = NULL;
  char *__pyx_v_name;
  int __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  int __pyx_t_3;
  fmi2_base_type_enu_t __pyx_t_4;
  fmi2_causality_enu_t __pyx_t_5;
  fmi2_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;
  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":3768
 *         cdef FMIL.fmi2_variable_alias_kind_enu_t alias_kind
 *         cdef char* desc
 *         cdef dict  variable_dict = {}             # <<<<<<<<<<<<<<
 *         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 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_variable_dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3769
 *         cdef char* desc
 *         cdef dict  variable_dict = {}
 *         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":3770
 *         cdef dict  variable_dict = {}
 *         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":3771
 *         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":3774
 *         cdef int   has_start, is_fixed
 *         cdef int   i
 *         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 = 3774; __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":3775
 *         cdef int   i
 *         cdef int  selected_filter = 1 if filter else 0
 *         cdef int  length_filter = 0             # <<<<<<<<<<<<<<
 * 
 *         variable_list      = FMIL.fmi2_import_get_variable_list(self._fmu, 0)
 */
  __pyx_v_length_filter = 0;

  /* "pyfmi\fmi.pyx":3777
 *         cdef int  length_filter = 0
 * 
 *         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":3778
 * 
 *         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":3780
 *         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_1 = PyObject_RichCompare(__pyx_v_type, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3780; __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 = 3780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3781
 * 
 *         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 = ((fmi2_base_type_enu_t)PyInt_AsLong(__pyx_v_type)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_type = __pyx_t_4;

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

    /* "pyfmi\fmi.pyx":3784
 *             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 = ((fmi2_causality_enu_t)PyInt_AsLong(__pyx_v_causality)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_causality = __pyx_t_5;

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

    /* "pyfmi\fmi.pyx":3787
 *             selected_causality = 1
 *         if variability != None: #A variability has been selected
 *             target_variability = variability             # <<<<<<<<<<<<<<
 *             selected_variability = 1
 *         if selected_filter:
 */
    __pyx_t_6 = ((fmi2_variability_enu_t)PyInt_AsLong(__pyx_v_variability)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_variability = __pyx_t_6;

    /* "pyfmi\fmi.pyx":3788
 *         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":3789
 *             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":3790
 *             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 = 3790; __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 = 3790; __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 = 3790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_v_filter_list = __pyx_t_8;
    __pyx_t_8 = 0;

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

  /* "pyfmi\fmi.pyx":3793
 *             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":3795
 *         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":3797
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 * 
 *             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_v_alias_kind = fmi2_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":3798
 * 
 *             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":3799
 *             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)
 *             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":3800
 *             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)             # <<<<<<<<<<<<<<
 *             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":3801
 *             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":3802
 *             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":3803
 *             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_causality = fmi2_import_get_causality(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":3804
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 *             data_causality   = FMIL.fmi2_import_get_causality(variable)
 *             desc             = FMIL.fmi2_import_get_variable_description(variable)             # <<<<<<<<<<<<<<
 * 
 *             #If only variables with start are wanted, check if the variable has start
 */
    __pyx_v_desc = fmi2_import_get_variable_description(__pyx_v_variable);

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

      /* "pyfmi\fmi.pyx":3812
 *             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":3813
 *                 #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":3814
 *                 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":3815
 *                     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":3817
 *                     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":3818
 * 
 *             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":3819
 *             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":3820
 *                 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":3821
 *             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":3822
 *                 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":3824
 *                 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":3825
 * 
 *             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":3826
 *             if selected_filter:
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__match); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_v_filter_list)) { __Pyx_RaiseUnboundLocalError("filter_list"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_filter_list, __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_16, 1, ((PyObject *)__pyx_t_1));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
        __pyx_t_8 = 0;
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __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_16)); __pyx_t_16 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_13) {

          /* "pyfmi\fmi.pyx":3827
 *                 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":3829
 *                         break
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if include_alias:
 */
        goto __pyx_L7_continue;
      }
      __pyx_L17_break:;
      goto __pyx_L15;
    }
    __pyx_L15:;

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

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

      /* "pyfmi\fmi.pyx":3834
 *                 #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)
 */
      __pyx_t_16 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_7 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if ((__pyx_v_desc != NULL)) {
        __pyx_t_17 = ((PyObject *)PyUnicode_DecodeUTF8(__pyx_v_desc, strlen(__pyx_v_desc), NULL)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_17));
        __pyx_t_8 = ((PyObject *)__pyx_t_17);
        __pyx_t_17 = 0;
      } else {
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
        __pyx_t_8 = ((PyObject *)__pyx_kp_s_6);
      }

      /* "pyfmi\fmi.pyx":3835
 *                 variable_dict[name] = ScalarVariable2(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,             # <<<<<<<<<<<<<<
 *                                        alias_kind)
 *             elif alias_kind == FMIL.fmi2_variable_is_not_alias:
 */
      __pyx_t_17 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_18 = PyInt_FromLong(__pyx_v_data_causality); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_18);

      /* "pyfmi\fmi.pyx":3836
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 *                                        alias_kind)             # <<<<<<<<<<<<<<
 *             elif alias_kind == FMIL.fmi2_variable_is_not_alias:
 *                 #Exclude alias
 */
      __pyx_t_19 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_20 = PyTuple_New(7); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_20, 4, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_20, 5, __pyx_t_18);
      __Pyx_GIVEREF(__pyx_t_18);
      PyTuple_SET_ITEM(__pyx_t_20, 6, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      __pyx_t_1 = 0;
      __pyx_t_16 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 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 = 3833; __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":3833
 *             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,
 */
      __pyx_t_20 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_20));
      if (PyDict_SetItem(((PyObject *)__pyx_v_variable_dict), ((PyObject *)__pyx_t_20), __pyx_t_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      goto __pyx_L19;
    }

    /* "pyfmi\fmi.pyx":3837
 *                                        data_variability, data_causality,
 *                                        alias_kind)
 *             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":3840
 *                 #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,
 */
      __pyx_t_19 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_19));

      /* "pyfmi\fmi.pyx":3841
 *                 #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)
 */
      __pyx_t_20 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_18 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_18);
      if ((__pyx_v_desc != NULL)) {
        __pyx_t_8 = ((PyObject *)PyUnicode_DecodeUTF8(__pyx_v_desc, strlen(__pyx_v_desc), NULL)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_8));
        __pyx_t_17 = ((PyObject *)__pyx_t_8);
        __pyx_t_8 = 0;
      } else {
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
        __pyx_t_17 = ((PyObject *)__pyx_kp_s_6);
      }

      /* "pyfmi\fmi.pyx":3842
 *                 variable_dict[name] = ScalarVariable2(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,             # <<<<<<<<<<<<<<
 *                                        alias_kind)
 * 
 */
      __pyx_t_8 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = PyInt_FromLong(__pyx_v_data_causality); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);

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

      /* "pyfmi\fmi.pyx":3840
 *                 #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,
 */
      __pyx_t_1 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      if (PyDict_SetItem(((PyObject *)__pyx_v_variable_dict), ((PyObject *)__pyx_t_1), __pyx_t_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      goto __pyx_L19;
    }
    __pyx_L19:;
    __pyx_L7_continue:;
  }

  /* "pyfmi\fmi.pyx":3846
 * 
 *         #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":3848
 *         FMIL.fmi2_import_free_variable_list(variable_list)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_references(self):
 */
  __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_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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_47get_variable_references(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_46get_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_47get_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_46get_variable_references(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_46get_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":3876
 *             [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_INCREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
  __pyx_v_vr_real = __pyx_v_self->_save_real_variables_val;

  /* "pyfmi\fmi.pyx":3877
 *         """
 *         vr_real = self._save_real_variables_val
 *         vr_int  = self._save_int_variables_val             # <<<<<<<<<<<<<<
 *         vr_bool = self._save_bool_variables_val
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
  __pyx_v_vr_int = __pyx_v_self->_save_int_variables_val;

  /* "pyfmi\fmi.pyx":3878
 *         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_INCREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
  __pyx_v_vr_bool = __pyx_v_self->_save_bool_variables_val;

  /* "pyfmi\fmi.pyx":3880
 *         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 = 3880; __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 = 3880; __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 = 3880; __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 = 3880; __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":3881
 * 
 *         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 = 3881; __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 = 3881; __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 = 3881; __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 = 3881; __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;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
    } 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 = 3881; __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 = 3881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3881; __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_INCREF(((PyObject *)__pyx_t_3));
  __pyx_v_vr_str = __pyx_t_3;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":3883
 *         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_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_model_variables); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3883; __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_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3883; __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_v_get_enum_var = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3884
 * 
 *         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 = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_get_enum_var, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3884; __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 = 3884; __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_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3884; __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_3); __pyx_t_3 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++;
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++;
    } else {
      __pyx_t_3 = __pyx_t_5(__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 = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_v_e);
    __pyx_v_e = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3884; __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_INCREF(((PyObject *)__pyx_t_1));
  __pyx_v_vr_enum = __pyx_t_1;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3886
 *         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, char* variablename) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_vr_real));
  PyTuple_SET_ITEM(__pyx_t_1, 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_1, 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_1, 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_1, 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_1, 4, ((PyObject *)__pyx_v_vr_enum));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_vr_enum));
  __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_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":3888
 *         return vr_real, vr_int, vr_bool, vr_str, vr_enum
 * 
 *     cpdef FMIL.fmi2_value_reference_t get_variable_valueref(self, char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Extract the ValueReference given a variable name.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_49get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static fmi2_value_reference_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_value_reference_t __pyx_v_vr;
  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;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_valueref", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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_71); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_49get_variable_valueref)) {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3888; __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 = 3888; __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 = 3888; __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 = __Pyx_PyInt_AsSize_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (fmi2_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":3904
 *         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":3905
 * 
 *         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_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

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

  /* "pyfmi\fmi.pyx":3907
 *         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":3909
 *         vr =  FMIL.fmi2_import_get_variable_vr(variable)
 * 
 *         return vr             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_base_type_enu_t get_variable_data_type(self, char* variablename) 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_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_49get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_48get_variable_valueref[] = "\n        Extract the ValueReference given a variable name.\n\n        Parameters::\n\n            variablename --\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_49get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_valueref (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 = 3888; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_48get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3888
 *         return vr_real, vr_int, vr_bool, vr_str, vr_enum
 * 
 *     cpdef FMIL.fmi2_value_reference_t get_variable_valueref(self, char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Extract the ValueReference given a variable name.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_48get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3888; __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 = 3888; __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":3911
 *         return vr
 * 
 *     cpdef FMIL.fmi2_base_type_enu_t get_variable_data_type(self, char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get data type of variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_51get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*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, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_base_type_enu_t __pyx_v_type;
  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;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_data_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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_70); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3911; __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_51get_variable_data_type)) {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3911; __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 = 3911; __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 = 3911; __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 = ((fmi2_base_type_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":3927
 *         cdef FMIL.fmi2_base_type_enu_t    type
 * 
 *         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":3928
 * 
 *         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":3929
 *         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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __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 = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __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 = 3929; __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 = 3929; __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 = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3931
 *             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":3933
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 * 
 *         return type             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_description(self, char* variablename):
 */
  __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_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_51get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_50get_variable_data_type[] = "\n        Get data type of variable.\n\n        Parameter::\n\n            variablename --\n                The name of the variable.\n\n        Returns::\n\n            The type of the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_51get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_data_type (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 = 3911; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_data_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_50get_variable_data_type(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3911
 *         return vr
 * 
 *     cpdef FMIL.fmi2_base_type_enu_t get_variable_data_type(self, char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get data type of variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_50get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3911; __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 = 3911; __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":3935
 *         return type
 * 
 *     cpdef get_variable_description(self, char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Get the description of a given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_53get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  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;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_description", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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_69); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3935; __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_53get_variable_description)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3935; __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 = 3935; __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 = 3935; __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":3951
 *         cdef char* desc
 * 
 *         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":3952
 * 
 *         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_4 = (__pyx_v_variable == NULL);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":3955
 *             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":3957
 *         desc = FMIL.fmi2_import_get_variable_description(variable)
 * 
 *         return desc if desc != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_variability_enu_t get_variable_variability(self,char* variablename) except *:
 */
  __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 = 3957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
    __pyx_t_3 = ((PyObject *)__pyx_kp_s_6);
  }
  __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.FMUModelBase2.get_variable_description", __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_53get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_52get_variable_description[] = "\n        Get the description of a given variable.\n\n        Parameter::\n\n            variablename --\n                The name of the variable\n\n        Returns::\n\n            The description of the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_53get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_description (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 = 3935; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_52get_variable_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_52get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3935; __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":3959
 *         return desc if desc != NULL else ""
 * 
 *     cpdef FMIL.fmi2_variability_enu_t get_variable_variability(self,char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get variability of the variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_55get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static fmi2_variability_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_variability_enu_t __pyx_v_variability;
  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;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_variability", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_87); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __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_55get_variable_variability)) {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __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 = 3959; __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 = ((fmi2_variability_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":3976
 *         cdef FMIL.fmi2_variability_enu_t variability
 * 
 *         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":3977
 * 
 *         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_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

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

  /* "pyfmi\fmi.pyx":3979
 *         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":3981
 *         variability = FMIL.fmi2_import_get_variability(variable)
 * 
 *         return variability             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_causality_enu_t get_variable_causality(self, char* variablename) 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_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_55get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_54get_variable_variability[] = "\n        Get variability of the variable.\n\n        Parameters::\n\n            variablename --\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_55get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_variability (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 = 3959; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_variability", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_54get_variable_variability(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3959
 *         return desc if desc != NULL else ""
 * 
 *     cpdef FMIL.fmi2_variability_enu_t get_variable_variability(self,char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get variability of the variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_54get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __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 = 3959; __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":3983
 *         return variability
 * 
 *     cpdef FMIL.fmi2_causality_enu_t get_variable_causality(self, char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get the causality of the variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_57get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static fmi2_causality_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_causality_enu_t __pyx_v_causality;
  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;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_causality", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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_89); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3983; __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_57get_variable_causality)) {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3983; __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 = 3983; __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 = 3983; __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 = ((fmi2_causality_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":4000
 *         cdef FMIL.fmi2_causality_enu_t causality
 * 
 *         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":4001
 * 
 *         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":4002
 *         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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4002; __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 = 4002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4002; __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 = 4002; __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 = 4002; __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 = 4002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4004
 *             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":4006
 *         causality = FMIL.fmi2_import_get_causality(variable)
 * 
 *         return causality             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_start(self, char* variablename):
 */
  __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_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_57get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_56get_variable_causality[] = "\n        Get the causality of the variable.\n\n        Parameters::\n\n            variablename --\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_57get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_causality (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 = 3983; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_causality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_56get_variable_causality(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3983
 *         return variability
 * 
 *     cpdef FMIL.fmi2_causality_enu_t get_variable_causality(self, char* variablename) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get the causality of the variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_56get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3983; __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 = 3983; __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":4008
 *         return causality
 * 
 *     cpdef get_variable_start(self, char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the start value for the variable or else raises
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_59get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename, 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;
  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("get_variable_start", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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 = 4008; __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_59get_variable_start)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4008; __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 = 4008; __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 = 4008; __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":4030
 *         cdef FMIL.fmi2_import_string_variable_t*  str_variable
 *         cdef int                                  status
 *         cdef FMIL.fmi2_boolean_t                  FMITRUE = 1             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_v_FMITRUE = 1;

  /* "pyfmi\fmi.pyx":4032
 *         cdef FMIL.fmi2_boolean_t                  FMITRUE = 1
 * 
 *         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":4033
 * 
 *         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_4 = (__pyx_v_variable == NULL);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":4036
 *             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":4038
 *         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_4 = (__pyx_v_status == 0);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":4041
 *             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":4043
 *         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_4 = (__pyx_v_type == fmi2_base_type_real);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4044
 * 
 *         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":4045
 *         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_1 = PyFloat_FromDouble(fmi2_import_get_real_variable_start(__pyx_v_real_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4045; __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_L5;
  }

  /* "pyfmi\fmi.pyx":4047
 *             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_4 = (__pyx_v_type == fmi2_base_type_int);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4048
 * 
 *         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":4049
 *         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_1 = PyInt_FromLong(fmi2_import_get_integer_variable_start(__pyx_v_int_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4049; __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_L5;
  }

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

    /* "pyfmi\fmi.pyx":4052
 * 
 *         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":4053
 *         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_1 = __Pyx_PyBool_FromLong((fmi2_import_get_boolean_variable_start(__pyx_v_bool_variable) == __pyx_v_FMITRUE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4053; __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_L5;
  }

  /* "pyfmi\fmi.pyx":4055
 *             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_4 = (__pyx_v_type == fmi2_base_type_enum);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4056
 * 
 *         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":4057
 *         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_1 = PyInt_FromLong(fmi2_import_get_enum_variable_start(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4057; __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_L5;
  }

  /* "pyfmi\fmi.pyx":4059
 *             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_4 = (__pyx_v_type == fmi2_base_type_str);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4060
 * 
 *         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":4061
 *         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_1 = PyBytes_FromString(fmi2_import_get_string_variable_start(__pyx_v_str_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4061; __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;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":4064
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self, char* variablename):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_218), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4064; __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 = 4064; __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_59get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_58get_variable_start[] = "\n        Returns the start value for the variable or else raises\n        FMUException.\n\n        Parameters::\n\n            variablename --\n                The name of the variable\n\n        Returns::\n\n            The start value.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_59get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_start (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 = 4008; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_58get_variable_start(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4008
 *         return causality
 * 
 *     cpdef get_variable_start(self, char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the start value for the variable or else raises
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_58get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4008; __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":4066
 *             raise FMUException("Unknown variable type.")
 * 
 *     cpdef get_variable_max(self, char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the maximum value for the given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename, 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;
  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("get_variable_max", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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 = 4066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_max)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4066; __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 = 4066; __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 = 4066; __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":4085
 *         cdef FMIL.fmi2_base_type_enu_t            type
 * 
 *         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":4086
 * 
 *         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_4 = (__pyx_v_variable == NULL);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":4089
 *             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":4091
 *         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_4 = (__pyx_v_type == fmi2_base_type_real);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4092
 * 
 *         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":4093
 *         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_3 = PyFloat_FromDouble(fmi2_import_get_real_variable_max(__pyx_v_real_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4093; __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;
  }

  /* "pyfmi\fmi.pyx":4095
 *             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_4 = (__pyx_v_type == fmi2_base_type_int);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4096
 * 
 *         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":4097
 *         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_3 = PyInt_FromLong(fmi2_import_get_integer_variable_max(__pyx_v_int_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":4099
 *             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_4 = (__pyx_v_type == fmi2_base_type_enum);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4100
 * 
 *         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":4101
 *         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_3 = PyInt_FromLong(fmi2_import_get_enum_variable_max(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4101; __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":4104
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self, char* variablename):
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_219), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4104; __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 = 4104; __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_60get_variable_max[] = "\n        Returns the maximum value for the given variable.\n\n        Parameters::\n\n            variablename --\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_61get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_max (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 = 4066; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_60get_variable_max(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4066
 *             raise FMUException("Unknown variable type.")
 * 
 *     cpdef get_variable_max(self, char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the maximum value for the given variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_60get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4066; __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":4106
 *             raise FMUException("The variable type does not have a maximum value.")
 * 
 *     cpdef get_variable_min(self, char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the minimum value for the given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename, 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;
  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("get_variable_min", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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 = 4106; __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_min)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4106; __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 = 4106; __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 = 4106; __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":4125
 *         cdef FMIL.fmi2_base_type_enu_t            type
 * 
 *         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":4126
 * 
 *         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_4 = (__pyx_v_variable == NULL);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":4129
 *             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":4131
 *         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_4 = (__pyx_v_type == fmi2_base_type_real);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4132
 * 
 *         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":4133
 *         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_3 = PyFloat_FromDouble(fmi2_import_get_real_variable_min(__pyx_v_real_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4133; __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;
  }

  /* "pyfmi\fmi.pyx":4135
 *             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_4 = (__pyx_v_type == fmi2_base_type_int);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4136
 * 
 *         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":4137
 *         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_3 = PyInt_FromLong(fmi2_import_get_integer_variable_min(__pyx_v_int_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4137; __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;
  }

  /* "pyfmi\fmi.pyx":4139
 *             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_4 = (__pyx_v_type == fmi2_base_type_enum);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4140
 * 
 *         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":4141
 *         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_3 = PyInt_FromLong(fmi2_import_get_enum_variable_min(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4141; __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":4144
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_220), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4144; __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 = 4144; __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_62get_variable_min[] = "\n        Returns the minimum value for the given variable.\n\n        Parameters::\n\n            variablename --\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_63get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_min (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 = 4106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_62get_variable_min(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4106
 *             raise FMUException("The variable type does not have a maximum value.")
 * 
 *     cpdef get_variable_min(self, char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the minimum value for the given variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_62get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename) {
  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_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4106; __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_65get_fmu_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_64get_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        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_65get_fmu_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_fmu_state (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_64get_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4150
 * 
 * 
 *     def get_fmu_state(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a copy of the recent FMU-state and returns
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_64get_fmu_state(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_fmu_state", 0);

  /* "pyfmi\fmi.pyx":4164
 *             FMU_state = Model.get_fmu_state()
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *         cdef int status
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4164; __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_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_67set_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_66set_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_67set_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_fmu_state (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_66set_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4183
 *         return state
 * 
 *     def set_fmu_state(self, state):             # <<<<<<<<<<<<<<
 *         """
 *         Set the FMU to a previous saved state.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_66set_fmu_state(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_fmu_state", 0);

  /* "pyfmi\fmi.pyx":4197
 *             Model.set_fmu_state(FMU_state)
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *         cdef int status
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4197; __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_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_69free_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_68free_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_69free_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_fmu_state (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_68free_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4215
 *         return None
 * 
 *     def free_fmu_state(self, state):             # <<<<<<<<<<<<<<
 *         """
 *         Free a previously saved FMU-state from the memory.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_68free_fmu_state(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("free_fmu_state", 0);

  /* "pyfmi\fmi.pyx":4230
 * 
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *         cdef int status
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4230; __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.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":4242
 *         return None
 * 
 *     cpdef serialize_fmu_state(self, state):             # <<<<<<<<<<<<<<
 *         """
 *         Serialize the data referenced by the input argumemt.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71serialize_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 overriden 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 = 4242; __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_71serialize_fmu_state)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4242; __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 = 4242; __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":4258
 *             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 = 4258; __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_71serialize_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_70serialize_fmu_state[] = "\n        Serialize the data referenced by the input argumemt.\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_71serialize_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_70serialize_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4242
 *         return None
 * 
 *     cpdef serialize_fmu_state(self, state):             # <<<<<<<<<<<<<<
 *         """
 *         Serialize the data referenced by the input argumemt.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_70serialize_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 = 4242; __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":4282
 *         return serialized_fmu
 * 
 *     cpdef deserialize_fmu_state(self, serialized_fmu):             # <<<<<<<<<<<<<<
 *         """
 *         Deserialize the provided byte-vector and returns the corresponding FMU-state.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73deserialize_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 overriden 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_221); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4282; __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_73deserialize_fmu_state)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4282; __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 = 4282; __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":4301
 *             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 = 4301; __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_73deserialize_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_serialized_fmu); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_72deserialize_fmu_state[] = "\n        Deserialize 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_73deserialize_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_72deserialize_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_serialized_fmu));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4282
 *         return serialized_fmu
 * 
 *     cpdef deserialize_fmu_state(self, serialized_fmu):             # <<<<<<<<<<<<<<
 *         """
 *         Deserialize the provided byte-vector and returns the corresponding FMU-state.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_72deserialize_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 = 4282; __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":4315
 *         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_75serialized_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 overriden 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_222); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4315; __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_75serialized_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 = 4315; __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 = 4315; __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":4328
 *             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 = 4328; __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_75serialized_fmu_state_size(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_74serialized_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_75serialized_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_74serialized_fmu_state_size(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4315
 *         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_74serialized_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 = 4315; __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_77get_ode_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_76get_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_77get_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_76get_ode_sizes(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4344
 * 
 * 
 *     def get_ode_sizes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the number of continuous states and the number of event
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_76get_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":4361
 *             [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 = 4361; __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 = 4361; __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 = 4361; __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_79get_default_experiment_start_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_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_13FMUModelBase2_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_13FMUModelBase2_78get_default_experiment_start_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4363
 *         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_78get_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":4368
 *         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 = 4368; __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_81get_default_experiment_stop_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_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_13FMUModelBase2_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_13FMUModelBase2_80get_default_experiment_stop_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* "pyfmi\fmi.pyx":4377
 *         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_82get_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":4382
 *         description.
 *         """
 *         return FMIL.fmi2_import_get_default_experiment_tolerance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def _convert_filter(self, expression):
 */
  __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 = 4382; __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_85_convert_filter(PyObject *__pyx_v_self, PyObject *__pyx_v_expression); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_84_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_85_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_84_convert_filter(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_expression));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4384
 *         return FMIL.fmi2_import_get_default_experiment_tolerance(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_84_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":4398
 *             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 = 4398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_regexp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4399
 *         """
 *         regexp = []
 *         if isinstance(expression,str):             # <<<<<<<<<<<<<<
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)(&PyString_Type)));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_expression, __pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4400
 *         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 = 4400; __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 = 4400; __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 = 4400; __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 = 4400; __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":4401
 *         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 = 4401; __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 = 4401; __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 = 4401; __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 = 4401; __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 = 4401; __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 = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":4402
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):             # <<<<<<<<<<<<<<
 *             for i in expression:
 *                 regex = fnmatch.translate(i)
 */
  __pyx_t_4 = ((PyObject *)((PyObject*)(&PyList_Type)));
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_expression, __pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4403
 *             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 = 4403; __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;
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++;
      } 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 = 4403; __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":4404
 *         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 = 4404; __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 = 4404; __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 = 4404; __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 = 4404; __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":4405
 *             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 = 4405; __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 = 4405; __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 = 4405; __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 = 4405; __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 = 4405; __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":4407
 *                 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 = 4407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_223), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __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 = 4407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4408
 *         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":4410
 *         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(CYTHON_UNUSED 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_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;
  size_t __pyx_t_3;
  size_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("_add_scalar_variables", 0);

  /* "pyfmi\fmi.pyx":4415
 *         """
 *         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 = 4415; __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 = 4415; __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":4417
 *         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":4419
 *         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":4421
 *         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":4423
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 * 
 *             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_2 = PyInt_FromLong(fmi2_import_get_variable_alias_kind(__pyx_v_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_alias_kind);
    __pyx_v_alias_kind = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":4424
 * 
 *             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":4425
 *             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":4426
 *             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_2 = PyInt_FromLong(fmi2_import_get_variable_base_type(__pyx_v_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_data_type);
    __pyx_v_data_type = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":4427
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 *             data_variability = FMIL.fmi2_import_get_variability(variable)             # <<<<<<<<<<<<<<
 *             data_causality   = FMIL.fmi2_import_get_causality(variable)
 *             desc             = FMIL.fmi2_import_get_variable_description(variable)
 */
    __pyx_t_2 = PyInt_FromLong(fmi2_import_get_variability(__pyx_v_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_data_variability);
    __pyx_v_data_variability = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":4428
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 *             data_causality   = FMIL.fmi2_import_get_causality(variable)             # <<<<<<<<<<<<<<
 *             desc             = FMIL.fmi2_import_get_variable_description(variable)
 * 
 */
    __pyx_t_2 = PyInt_FromLong(fmi2_import_get_causality(__pyx_v_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_data_causality);
    __pyx_v_data_causality = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":4429
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 *             data_causality   = FMIL.fmi2_import_get_causality(variable)
 *             desc             = FMIL.fmi2_import_get_variable_description(variable)             # <<<<<<<<<<<<<<
 * 
 *             variable_dict[name] = ScalarVariable2(name,
 */
    __pyx_v_desc = fmi2_import_get_variable_description(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4431
 *             desc             = FMIL.fmi2_import_get_variable_description(variable)
 * 
 *             variable_dict[name] = ScalarVariable2(name,             # <<<<<<<<<<<<<<
 *                                     value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                     data_variability, data_causality,
 */
    __pyx_t_2 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));

    /* "pyfmi\fmi.pyx":4432
 * 
 *             variable_dict[name] = ScalarVariable2(name,
 *                                     value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",             # <<<<<<<<<<<<<<
 *                                     data_variability, data_causality,
 *                                     alias_kind)
 */
    __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if ((__pyx_v_desc != NULL)) {
      __pyx_t_6 = ((PyObject *)PyUnicode_DecodeUTF8(__pyx_v_desc, strlen(__pyx_v_desc), NULL)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __pyx_t_5 = ((PyObject *)__pyx_t_6);
      __pyx_t_6 = 0;
    } else {
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
      __pyx_t_5 = ((PyObject *)__pyx_kp_s_6);
    }

    /* "pyfmi\fmi.pyx":4434
 *                                     value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                     data_variability, data_causality,
 *                                     alias_kind)             # <<<<<<<<<<<<<<
 * 
 *         return variable_dict
 */
    __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4431; __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, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_data_type);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_data_type);
    __Pyx_GIVEREF(__pyx_v_data_type);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_data_variability);
    PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_data_variability);
    __Pyx_GIVEREF(__pyx_v_data_variability);
    __Pyx_INCREF(__pyx_v_data_causality);
    PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_v_data_causality);
    __Pyx_GIVEREF(__pyx_v_data_causality);
    __Pyx_INCREF(__pyx_v_alias_kind);
    PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_v_alias_kind);
    __Pyx_GIVEREF(__pyx_v_alias_kind);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;

    /* "pyfmi\fmi.pyx":4431
 *             desc             = FMIL.fmi2_import_get_variable_description(variable)
 * 
 *             variable_dict[name] = ScalarVariable2(name,             # <<<<<<<<<<<<<<
 *                                     value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                     data_variability, data_causality,
 */
    __pyx_t_6 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    if (PyObject_SetItem(__pyx_v_variable_dict, ((PyObject *)__pyx_t_6), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "pyfmi\fmi.pyx":4436
 *                                     alias_kind)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_derivatives_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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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_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_87get_derivatives_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_86get_derivatives_list[] = "\n        Returns a dictonary with the states derivatives.\n\n        Returns::\n\n            An ordered dictonary with the derivative variables.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_87get_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_86get_derivatives_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4438
 *         return variable_dict
 * 
 *     def get_derivatives_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictonary with the states derivatives.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_86get_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":4448
 *         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":4449
 * 
 *         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":4450
 *         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 = 4450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_225), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_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 = 4450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4452
 *             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 = 4452; __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":4455
 * 
 *         #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":4457
 *         FMIL.fmi2_import_free_variable_list(variable_list)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_states_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_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;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_89get_states_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_88get_states_list[] = "\n        Returns a dictonary with the states.\n\n        Returns::\n\n            An ordered dictonary with the state variables.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_89get_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_88get_states_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4459
 *         return variable_dict
 * 
 *     def get_states_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictonary with the states.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_88get_states_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_states_list", 0);

  /* "pyfmi\fmi.pyx":4469
 *         cdef FMIL.fmi2_import_variable_list_t*   variable_list
 * 
 *         variable_list = FMIL.fmi2_import_get_states_list(self._fmu)             # <<<<<<<<<<<<<<
 *         if variable_list == NULL:
 *             raise FMUException("The returned states list is NULL.")
 */
  __pyx_v_variable_list = fmi2_import_get_states_list(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":4470
 * 
 *         variable_list = FMIL.fmi2_import_get_states_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":4471
 *         variable_list = FMIL.fmi2_import_get_states_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 = 4471; __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 = 4471; __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 = 4471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4473
 *             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 = 4473; __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":4476
 * 
 *         #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":4478
 *         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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_91get_input_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_90get_input_list[] = "\n        Returns a dictonary with input variables\n\n        Returns::\n\n            An ordered dictonary with the input variables.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_91get_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_90get_input_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_90get_input_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  fmi2_import_variable_list_t *__pyx_v_input_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_input_list", 0);

  /* "pyfmi\fmi.pyx":4490
 *         cdef FMIL.fmi2_import_variable_list_t*   input_list
 * 
 *         input_list = FMIL.fmi2_import_get_inputs_list(self._fmu)             # <<<<<<<<<<<<<<
 *         if input_list == NULL:
 *             raise FMUException("The returned input list is NULL.")
 */
  __pyx_v_input_list = fmi2_import_get_inputs_list(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":4491
 * 
 *         input_list = FMIL.fmi2_import_get_inputs_list(self._fmu)
 *         if input_list == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The returned input list is NULL.")
 * 
 */
  __pyx_t_1 = (__pyx_v_input_list == NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4492
 *         input_list = FMIL.fmi2_import_get_inputs_list(self._fmu)
 *         if input_list == NULL:
 *             raise FMUException("The returned input list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         variable_dict = self._add_scalar_variables(input_list)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_228), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4492; __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 = 4492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4494
 *             raise FMUException("The returned input list is NULL.")
 * 
 *         variable_dict = self._add_scalar_variables(input_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_input_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4494; __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":4497
 * 
 *         #Free the variable list
 *         FMIL.fmi2_import_free_variable_list(input_list)             # <<<<<<<<<<<<<<
 * 
 *         return variable_dict
 */
  fmi2_import_free_variable_list(__pyx_v_input_list);

  /* "pyfmi\fmi.pyx":4499
 *         FMIL.fmi2_import_free_variable_list(input_list)
 * 
 *         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_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_93get_output_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_92get_output_list[] = "\n        Returns a dictonary with output variables\n\n        Returns::\n\n            An ordered dictonary with the output variables.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_93get_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_92get_output_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_92get_output_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  fmi2_import_variable_list_t *__pyx_v_output_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_output_list", 0);

  /* "pyfmi\fmi.pyx":4511
 *         cdef FMIL.fmi2_import_variable_list_t*   output_list
 * 
 *         output_list = FMIL.fmi2_import_get_outputs_list(self._fmu)             # <<<<<<<<<<<<<<
 *         if output_list == NULL:
 *             raise FMUException("The returned input list is NULL.")
 */
  __pyx_v_output_list = fmi2_import_get_outputs_list(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":4512
 * 
 *         output_list = FMIL.fmi2_import_get_outputs_list(self._fmu)
 *         if output_list == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The returned input list is NULL.")
 * 
 */
  __pyx_t_1 = (__pyx_v_output_list == NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4513
 *         output_list = FMIL.fmi2_import_get_outputs_list(self._fmu)
 *         if output_list == NULL:
 *             raise FMUException("The returned input list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         variable_dict = self._add_scalar_variables(output_list)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_229), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4513; __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 = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4515
 *             raise FMUException("The returned input list is NULL.")
 * 
 *         variable_dict = self._add_scalar_variables(output_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_output_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_variable_dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4518
 * 
 *         #Free the variable list
 *         FMIL.fmi2_import_free_variable_list(output_list)             # <<<<<<<<<<<<<<
 * 
 *         return variable_dict
 */
  fmi2_import_free_variable_list(__pyx_v_output_list);

  /* "pyfmi\fmi.pyx":4520
 *         FMIL.fmi2_import_free_variable_list(output_list)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_capability_flags(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_output_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_95get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_94get_capability_flags[] = "\n        Returns a dictionary with the cability flags of the FMU.\n\n        Returns::\n\n            me_needsExecutionTool\n            me_completedIntegratorStepNotNeeded\n            me_canBeInstantiatedOnlyOncePerProcess\n            me_canNotUseMemoryManagementFunctions\n            me_canGetAndSetFMUstate\n            me_canSerializeFMUstate\n            me_providesDirectionalDerivatives\n            me_completedEventIterationIsProvided\n            cs_needsExecutionTool\n            cs_canHandleVariableCommunicationStepSize\n            cs_canHandleEvents\n            cs_canInterpolateInputs\n            cs_maxOutputDerivativeOrder\n            cs_canRunAsynchronuously\n            cs_canSignalEvents\n            cs_canBeInstantiatedOnlyOncePerProcess\n            cs_canNotUseMemoryManagementFunctions\n            cs_canGetAndSetFMUstate\n            cs_canSerializeFMUstate\n            capabilities_Num\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_95get_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_13FMUModelBase2_94get_capability_flags(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4522
 *         return variable_dict
 * 
 *     def get_capability_flags(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the cability flags of the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_94get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_v_capabilities = 0;
  PyObject *__pyx_v_cap = 0;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  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_capability_flags", 0);

  /* "pyfmi\fmi.pyx":4549
 *             capabilities_Num
 *         """
 *         cdef dict capabilities = {}             # <<<<<<<<<<<<<<
 *         cdef dict cap          = {}
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_capabilities = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4550
 *         """
 *         cdef dict capabilities = {}
 *         cdef dict cap          = {}             # <<<<<<<<<<<<<<
 * 
 *         capabilities['me_needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_needsExecutionTool))
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_cap = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4552
 *         cdef dict cap          = {}
 * 
 *         capabilities['me_needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_needsExecutionTool))             # <<<<<<<<<<<<<<
 *         capabilities['me_completedIntegratorStepNotNeeded']       = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))
 *         capabilities['me_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->_fmu, fmi2_me_needsExecutionTool)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4552; __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 = 4552; __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 = 4552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_230), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4553
 * 
 *         capabilities['me_needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_needsExecutionTool))
 *         capabilities['me_completedIntegratorStepNotNeeded']       = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))             # <<<<<<<<<<<<<<
 *         capabilities['me_canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['me_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->_fmu, fmi2_me_completedIntegratorStepNotNeeded)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4553; __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 = 4553; __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 = 4553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_231), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4554
 *         capabilities['me_needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_needsExecutionTool))
 *         capabilities['me_completedIntegratorStepNotNeeded']       = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))
 *         capabilities['me_canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))             # <<<<<<<<<<<<<<
 *         capabilities['me_canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))
 *         capabilities['me_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->_fmu, fmi2_me_canBeInstantiatedOnlyOncePerProcess)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4554; __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 = 4554; __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 = 4554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_232), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4555
 *         capabilities['me_completedIntegratorStepNotNeeded']       = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))
 *         capabilities['me_canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['me_canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))             # <<<<<<<<<<<<<<
 *         capabilities['me_canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))
 *         capabilities['me_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->_fmu, fmi2_me_canNotUseMemoryManagementFunctions)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4555; __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 = 4555; __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 = 4555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_233), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4556
 *         capabilities['me_canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['me_canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))
 *         capabilities['me_canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))             # <<<<<<<<<<<<<<
 *         capabilities['me_canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))
 *         capabilities['me_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->_fmu, fmi2_me_canGetAndSetFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4556; __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 = 4556; __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 = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_234), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4557
 *         capabilities['me_canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))
 *         capabilities['me_canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))
 *         capabilities['me_canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))             # <<<<<<<<<<<<<<
 *         capabilities['me_providesDirectionalDerivatives']         = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives))
 *         capabilities['me_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->_fmu, fmi2_me_canSerializeFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4557; __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 = 4557; __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 = 4557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_235), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4558
 *         capabilities['me_canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))
 *         capabilities['me_canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))
 *         capabilities['me_providesDirectionalDerivatives']         = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives))             # <<<<<<<<<<<<<<
 *         capabilities['me_completedEventIterationIsProvided']      = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedEventIterationIsProvided))
 *         capabilities['cs_needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->_fmu, fmi2_me_providesDirectionalDerivatives)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4558; __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 = 4558; __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 = 4558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_236), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4559
 *         capabilities['me_canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))
 *         capabilities['me_providesDirectionalDerivatives']         = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives))
 *         capabilities['me_completedEventIterationIsProvided']      = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedEventIterationIsProvided))             # <<<<<<<<<<<<<<
 *         capabilities['cs_needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))
 *         capabilities['cs_canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->_fmu, fmi2_me_completedEventIterationIsProvided)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4559; __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 = 4559; __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 = 4559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_237), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4560
 *         capabilities['me_providesDirectionalDerivatives']         = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives))
 *         capabilities['me_completedEventIterationIsProvided']      = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedEventIterationIsProvided))
 *         capabilities['cs_needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))             # <<<<<<<<<<<<<<
 *         capabilities['cs_canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))
 *         capabilities['cs_canHandleEvents']                        = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleEvents))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->_fmu, fmi2_cs_needsExecutionTool)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4560; __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 = 4560; __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 = 4560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_238), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4561
 *         capabilities['me_completedEventIterationIsProvided']      = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedEventIterationIsProvided))
 *         capabilities['cs_needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))
 *         capabilities['cs_canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))             # <<<<<<<<<<<<<<
 *         capabilities['cs_canHandleEvents']                        = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleEvents))
 *         capabilities['cs_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->_fmu, fmi2_cs_canHandleVariableCommunicationStepSize)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4561; __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 = 4561; __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 = 4561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_239), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4562
 *         capabilities['cs_needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))
 *         capabilities['cs_canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))
 *         capabilities['cs_canHandleEvents']                        = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleEvents))             # <<<<<<<<<<<<<<
 *         capabilities['cs_canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))
 *         capabilities['cs_maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->_fmu, fmi2_cs_canHandleEvents)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4562; __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 = 4562; __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 = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s__cs_canHandleEvents), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4563
 *         capabilities['cs_canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))
 *         capabilities['cs_canHandleEvents']                        = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleEvents))
 *         capabilities['cs_canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))             # <<<<<<<<<<<<<<
 *         capabilities['cs_maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 *         capabilities['cs_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->_fmu, fmi2_cs_canInterpolateInputs)); 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_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4563; __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 = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_240), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4564
 *         capabilities['cs_canHandleEvents']                        = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleEvents))
 *         capabilities['cs_canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))
 *         capabilities['cs_maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)             # <<<<<<<<<<<<<<
 *         capabilities['cs_canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))
 *         capabilities['cs_canSignalEvents']                        = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSignalEvents))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->_fmu, fmi2_cs_maxOutputDerivativeOrder)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_241), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4565
 *         capabilities['cs_canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))
 *         capabilities['cs_maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 *         capabilities['cs_canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))             # <<<<<<<<<<<<<<
 *         capabilities['cs_canSignalEvents']                        = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSignalEvents))
 *         capabilities['cs_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->_fmu, fmi2_cs_canRunAsynchronuously)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4565; __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 = 4565; __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 = 4565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_242), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4566
 *         capabilities['cs_maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 *         capabilities['cs_canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))
 *         capabilities['cs_canSignalEvents']                        = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSignalEvents))             # <<<<<<<<<<<<<<
 *         capabilities['cs_canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['cs_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->_fmu, fmi2_cs_canSignalEvents)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4566; __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 = 4566; __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 = 4566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s__cs_canSignalEvents), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4567
 *         capabilities['cs_canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))
 *         capabilities['cs_canSignalEvents']                        = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSignalEvents))
 *         capabilities['cs_canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))             # <<<<<<<<<<<<<<
 *         capabilities['cs_canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))
 *         capabilities['cs_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->_fmu, fmi2_cs_canBeInstantiatedOnlyOncePerProcess)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4567; __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 = 4567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_243), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4568
 *         capabilities['cs_canSignalEvents']                        = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSignalEvents))
 *         capabilities['cs_canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['cs_canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))             # <<<<<<<<<<<<<<
 *         capabilities['cs_canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))
 *         capabilities['cs_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->_fmu, fmi2_cs_canNotUseMemoryManagementFunctions)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4568; __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 = 4568; __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 = 4568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_244), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4569
 *         capabilities['cs_canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['cs_canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))
 *         capabilities['cs_canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))             # <<<<<<<<<<<<<<
 *         capabilities['cs_canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSerializeFMUstate))
 *         capabilities['capabilities_Num']                          = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_capabilities_Num)
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->_fmu, fmi2_cs_canGetAndSetFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4569; __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 = 4569; __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 = 4569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_245), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4570
 *         capabilities['cs_canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))
 *         capabilities['cs_canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))
 *         capabilities['cs_canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSerializeFMUstate))             # <<<<<<<<<<<<<<
 *         capabilities['capabilities_Num']                          = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_capabilities_Num)
 * 
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->_fmu, fmi2_cs_canSerializeFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4570; __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 = 4570; __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 = 4570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_246), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4571
 *         capabilities['cs_canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))
 *         capabilities['cs_canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSerializeFMUstate))
 *         capabilities['capabilities_Num']                          = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_capabilities_Num)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(self,FMUModelME2):
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->_fmu, fmi2_capabilities_Num)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s__capabilities_Num), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4573
 *         capabilities['capabilities_Num']                          = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_capabilities_Num)
 * 
 *         if isinstance(self,FMUModelME2):             # <<<<<<<<<<<<<<
 *             for key in sorted(capabilities.keys())[12:20]:
 *                 cap[key] = capabilities[key]
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME2));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4574
 * 
 *         if isinstance(self,FMUModelME2):
 *             for key in sorted(capabilities.keys())[12:20]:             # <<<<<<<<<<<<<<
 *                 cap[key] = capabilities[key]
 *             key = sorted(capabilities.keys())[0]
 */
    __pyx_t_1 = PyDict_Keys(__pyx_v_capabilities); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4574; __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 = 4574; __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_sorted, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_t_1, 12, 20); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4574; __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_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++;
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++;
      } else {
        __pyx_t_3 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_v_key);
      __pyx_v_key = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4575
 *         if isinstance(self,FMUModelME2):
 *             for key in sorted(capabilities.keys())[12:20]:
 *                 cap[key] = capabilities[key]             # <<<<<<<<<<<<<<
 *             key = sorted(capabilities.keys())[0]
 *             cap[key] = capabilities[key]
 */
      __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_capabilities), __pyx_v_key); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(((PyObject *)__pyx_v_cap), __pyx_v_key, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4575; __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;

    /* "pyfmi\fmi.pyx":4576
 *             for key in sorted(capabilities.keys())[12:20]:
 *                 cap[key] = capabilities[key]
 *             key = sorted(capabilities.keys())[0]             # <<<<<<<<<<<<<<
 *             cap[key] = capabilities[key]
 *             return cap
 */
    __pyx_t_1 = PyDict_Keys(__pyx_v_capabilities); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4576; __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 = 4576; __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_sorted, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_key);
    __pyx_v_key = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4577
 *                 cap[key] = capabilities[key]
 *             key = sorted(capabilities.keys())[0]
 *             cap[key] = capabilities[key]             # <<<<<<<<<<<<<<
 *             return cap
 * 
 */
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_capabilities), __pyx_v_key); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(((PyObject *)__pyx_v_cap), __pyx_v_key, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4578
 *             key = sorted(capabilities.keys())[0]
 *             cap[key] = capabilities[key]
 *             return cap             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(self,FMUModelCS2):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_cap));
    __pyx_r = ((PyObject *)__pyx_v_cap);
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":4580
 *             return cap
 * 
 *         elif isinstance(self,FMUModelCS2):             # <<<<<<<<<<<<<<
 *             for key in sorted(capabilities.keys())[0:12]:
 *                 cap[key] = capabilities[key]
 */
  __pyx_t_3 = ((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2));
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4581
 * 
 *         elif isinstance(self,FMUModelCS2):
 *             for key in sorted(capabilities.keys())[0:12]:             # <<<<<<<<<<<<<<
 *                 cap[key] = capabilities[key]
 *             return cap
 */
    __pyx_t_3 = PyDict_Keys(__pyx_v_capabilities); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_t_3, 0, 12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__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_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4581; __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_1); __pyx_t_1 = 0;
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
      } else {
        __pyx_t_1 = __pyx_t_5(__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 = 4581; __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":4582
 *         elif isinstance(self,FMUModelCS2):
 *             for key in sorted(capabilities.keys())[0:12]:
 *                 cap[key] = capabilities[key]             # <<<<<<<<<<<<<<
 *             return cap
 * 
 */
      __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_capabilities), __pyx_v_key); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(((PyObject *)__pyx_v_cap), __pyx_v_key, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4582; __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;

    /* "pyfmi\fmi.pyx":4583
 *             for key in sorted(capabilities.keys())[0:12]:
 *                 cap[key] = capabilities[key]
 *             return cap             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_cap));
    __pyx_r = ((PyObject *)__pyx_v_cap);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":4586
 * 
 *         else:
 *             raise FMUException('The instance is not curent an instance of an ME-model or a CS-model. Use load_fmu for correct loading.')             # <<<<<<<<<<<<<<
 * 
 *     def get_directional_derivative(self, var_ref, func_ref, v):
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_248), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4586; __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 = 4586; __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_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_capability_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_capabilities);
  __Pyx_XDECREF(__pyx_v_cap);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_97get_directional_derivative(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_96get_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 eveluation 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 specifing 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_97get_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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__var_ref,&__pyx_n_s__func_ref,&__pyx_n_s__v,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_directional_derivative (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__var_ref);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__func_ref);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_directional_derivative", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4588; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__v);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_directional_derivative", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4588; __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 = 4588; __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 = 4588; __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_96get_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":4588
 *             raise FMUException('The instance is not curent an instance of an ME-model or a CS-model. Use load_fmu for correct loading.')
 * 
 *     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_96get_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;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(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":4640
 * 
 *         #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 = 4640; __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 = 4640; __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 = 4640; __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 = 4640; __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 = 4640; __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 = 4640; __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 = 4640; __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 = 4640; __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 = 4640; __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 = 4640; __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 = 4640; __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 = 4640; __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":4641
 *         #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 = 4641; __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 = 4641; __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 = 4641; __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 = 4641; __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 = 4641; __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 = 4641; __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 = 4641; __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 = 4641; __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 = 4641; __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 = 4641; __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 = 4641; __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 = 4641; __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":4642
 *         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 = 4642; __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 = 4642; __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 = 4642; __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 = 4642; __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 = 4642; __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 = 4642; __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 = 4642; __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 = 4642; __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 = 4642; __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 = 4642; __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 = 4642; __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 = 4642; __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":4644
 *         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 FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4644; __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 = 4644; __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 = 4644; __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 = 4644; __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 = 4644; __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 = 4644; __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 = 4644; __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 = 4644; __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 = 4644; __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 = 4644; __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 = 4644; __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 = 4644; __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":4646
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dz    = N.zeros(len(func_ref), dtype = N.double)
 * 
 *         if not FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives):             # <<<<<<<<<<<<<<
 *             raise FMUException('This FMU does not provide directional derivatives')
 * 
 */
  __pyx_t_11 = (!fmi2_import_get_capability(__pyx_v_self->_fmu, fmi2_me_providesDirectionalDerivatives));
  if (__pyx_t_11) {

    /* "pyfmi\fmi.pyx":4647
 * 
 *         if not FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives):
 *             raise FMUException('This FMU does not provide directional derivatives')             # <<<<<<<<<<<<<<
 * 
 *         if len(var_ref) != len(v):
 */
    __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_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_250), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_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 = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4649
 *             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 = 4649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_3 != __pyx_t_12);
  if (__pyx_t_11) {

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

  /* "pyfmi\fmi.pyx":4652
 *             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_12 = PyObject_Length(__pyx_v_var_ref); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4652; __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 = 4652; __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 = 4652; __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_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_13 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++;
    } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++;
    } else {
      __pyx_t_1 = __pyx_t_13(__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 = 4652; __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":4653
 * 
 *         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_1 = PyObject_GetItem(__pyx_v_var_ref, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetItem(((PyObject *)__pyx_v_v_ref), __pyx_v_i, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":4654
 *         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_1 = PyObject_GetItem(__pyx_v_v, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetItem(((PyObject *)__pyx_v_dv), __pyx_v_i, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4654; __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":4655
 *             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_12 = PyObject_Length(__pyx_v_func_ref); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4655; __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 = 4655; __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 = 4655; __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_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
    } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
    } else {
      __pyx_t_2 = __pyx_t_13(__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 = 4655; __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":4656
 *             dv[i] = v[i]
 *         for j in range(len(func_ref)):
 *             z_ref[j] = func_ref[j]             # <<<<<<<<<<<<<<
 * 
 *         nv = len(v_ref)
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v_func_ref, __pyx_v_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyObject_SetItem(((PyObject *)__pyx_v_z_ref), __pyx_v_j, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4656; __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":4658
 *             z_ref[j] = func_ref[j]
 * 
 *         nv = len(v_ref)             # <<<<<<<<<<<<<<
 *         nz = len(z_ref)
 * 
 */
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_v_ref)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nv = __pyx_t_12;

  /* "pyfmi\fmi.pyx":4659
 * 
 *         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_12 = PyObject_Length(((PyObject *)__pyx_v_z_ref)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nz = __pyx_t_12;

  /* "pyfmi\fmi.pyx":4661
 *         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":4663
 *         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_11 = (__pyx_v_status != 0);
  if (__pyx_t_11) {

    /* "pyfmi\fmi.pyx":4664
 * 
 *         if status != 0:
 *             raise FMUException('An error occured while getting the directional derivative, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         return dz
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_254), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4664; __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 = 4664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":4666
 *             raise FMUException('An error occured while getting the directional derivative, see the log for possible more information')
 * 
 *         return dz             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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_99get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_98get_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_99get_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_98get_version(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_98get_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":4685
 *             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":4686
 *         """
 *         cdef char* version = FMIL.fmi2_import_get_version(self._fmu)
 *         return version             # <<<<<<<<<<<<<<
 * 
 *     def get_name(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 = 4686; __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_101get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_100get_name[] = "\n        Return the model name as used in the modeling environment.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_101get_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_100get_name(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

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

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_102get_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":4699
 *         """
 *         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":4700
 *         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 = 4700; __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_6));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_6);
  }
  __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_105get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_104get_description[] = "\n        Return the model description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_105get_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_104get_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_104get_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":4707
 *         """
 *         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":4708
 *         cdef char* desc
 *         desc = FMIL.fmi2_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 = 4708; __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_6));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_6);
  }
  __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_107get_generation_tool(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_106get_generation_tool[] = "\n        Return the model generation tool.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_107get_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_106get_generation_tool(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_106get_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":4715
 *         """
 *         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":4716
 *         cdef char* gen
 *         gen = FMIL.fmi2_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 = 4716; __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_6));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_6);
  }
  __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_109get_guid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_108get_guid[] = "\n        Return the model GUID.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_109get_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_108get_guid(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_108get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_guid;
  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_guid", 0);

  /* "pyfmi\fmi.pyx":4722
 *         Return the model GUID.
 *         """
 *         guid = FMIL.fmi2_import_get_GUID(self._fmu)             # <<<<<<<<<<<<<<
 *         return guid
 * 
 */
  __pyx_v_guid = fmi2_import_get_GUID(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":4723
 *         """
 *         guid = FMIL.fmi2_import_get_GUID(self._fmu)
 *         return guid             # <<<<<<<<<<<<<<
 * 
 *     def get_identifier(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_guid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4723; __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_guid", __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_111get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_110get_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_111get_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_110get_identifier(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4725
 *         return guid
 * 
 *     def get_identifier(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model identifier, name of binary model file and prefix in
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_110get_identifier(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_identifier", 0);

  /* "pyfmi\fmi.pyx":4730
 *         the C-function names of the model.
 *         """
 *         return self._modelId             # <<<<<<<<<<<<<<
 * 
 *     def get_model_types_platform(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_self->_modelId); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4730; __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_identifier", __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_113get_model_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_112get_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_113get_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_112get_model_types_platform(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4732
 *         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_112get_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":4737
 *         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 = 4737; __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 object         _fmu_temp_dir
 *     cdef object         _fmu_full_path
 *     cdef public object  _enable_logging             # <<<<<<<<<<<<<<
 *     cdef object         _allocated_context
 *     cdef object         _allocated_xml
 */

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_13_fmu_log_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":159
 *     cdef char*          _modelId
 *     cdef object         _modelName
 *     cdef public object  _fmu_log_name             # <<<<<<<<<<<<<<
 *     cdef list           _categories
 *     cdef public list    _save_real_variables_val
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name___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->_fmu_log_name);
  __pyx_r = __pyx_v_self->_fmu_log_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 int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name_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_13_fmu_log_name_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_13_fmu_log_name_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->_fmu_log_name);
  __Pyx_DECREF(__pyx_v_self->_fmu_log_name);
  __pyx_v_self->_fmu_log_name = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name_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->_fmu_log_name);
  __Pyx_DECREF(__pyx_v_self->_fmu_log_name);
  __pyx_v_self->_fmu_log_name = 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":161
 *     cdef public object  _fmu_log_name
 *     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 = 161; __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":162
 *     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 = 162; __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":163
 *     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 = 163; __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":165
 *     cdef public list    _save_bool_variables_val
 *     cdef object         __t
 *     cdef public object  _pyEventInfo             # <<<<<<<<<<<<<<
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message)
 */

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 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 logmessages.\n                Default: \"\" (Generates automatically)\n\n        Returns::\n\n            A model as an object from the class FMUModelCS2\n        ";
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelCS2___init__;
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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,&__pyx_n_s__log_file_name,0};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_13);
    values[2] = __pyx_k_255;
    values[3] = ((PyObject *)__pyx_kp_s_6);
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[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, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4745; __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("__init__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4745; __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4745
 *     """
 * 
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = ""):             # <<<<<<<<<<<<<<
 *         """
 *         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) {
  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":4772
 * 
 *         #Call super
 *         FMUModelBase2.__init__(self, fmu, path, enable_logging, log_file_name)             # <<<<<<<<<<<<<<
 * 
 *         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 = 4772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4772; __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_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4772; __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":4774
 *         FMUModelBase2.__init__(self, fmu, path, enable_logging, log_file_name)
 * 
 *         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 1.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":4775
 * 
 *         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 1.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":4776
 *         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 1.0 for Co-simulation.")             # <<<<<<<<<<<<<<
 * 
 *         if self.get_capability_flags()['cs_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 = 4776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_256), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_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 = 4776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4778
 *                 raise FMUException("This class only supports FMI 1.0 for Co-simulation.")
 * 
 *         if self.get_capability_flags()['cs_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_257); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4778; __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 = 4778; __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_238)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4778; __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 = 4778; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4778; __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_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4779
 * 
 *         if self.get_capability_flags()['cs_needsExecutionTool'] == True:
 *             raise FMUException('Models that need an execution tool are not supported')             # <<<<<<<<<<<<<<
 * 
 *         self._modelId = 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 = 4779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_259), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4779; __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 = 4779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":4781
 *             raise FMUException('Models that need an execution tool are not supported')
 * 
 *         self._modelId = FMIL.fmi2_import_get_model_identifier_CS(self._fmu)             # <<<<<<<<<<<<<<
 *         self.instantiate_slave()
 * 
 */
  __pyx_v_self->__pyx_base._modelId = fmi2_import_get_model_identifier_CS(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":4782
 * 
 *         self._modelId = FMIL.fmi2_import_get_model_identifier_CS(self._fmu)
 *         self.instantiate_slave()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__instantiate_slave); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4782; __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 = 4782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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":4784
 *         self.instantiate_slave()
 * 
 *     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;
  char *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyfmi\fmi.pyx":4788
 *         Deallocate memory allocated
 *         """
 *         if self._allocated_fmu:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_terminate_slave(self._fmu)
 *             FMIL.fmi2_import_free_slave_instance(self._fmu)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_fmu); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4789
 *         """
 *         if self._allocated_fmu:
 *             FMIL.fmi2_import_terminate_slave(self._fmu)             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free_slave_instance(self._fmu)
 * 
 */
    fmi2_import_terminate_slave(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":4790
 *         if self._allocated_fmu:
 *             FMIL.fmi2_import_terminate_slave(self._fmu)
 *             FMIL.fmi2_import_free_slave_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll:
 */
    fmi2_import_free_slave_instance(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4792
 *             FMIL.fmi2_import_free_slave_instance(self._fmu)
 * 
 *         if self._allocated_dll:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_dll); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4793
 * 
 *         if self._allocated_dll:
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_xml:
 */
    fmi2_import_destroy_dllfmu(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":4795
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 *         if self._allocated_xml:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free(self._fmu)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_xml); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4796
 * 
 *         if self._allocated_xml:
 *             FMIL.fmi2_import_free(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_context:
 */
    fmi2_import_free(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":4798
 *             FMIL.fmi2_import_free(self._fmu)
 * 
 *         if self._allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(self._context)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_context); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4799
 * 
 *         if self._allocated_context:
 *             FMIL.fmi_import_free_context(self._context)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_temp_dir:
 */
    fmi_import_free_context(__pyx_v_self->__pyx_base._context);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":4801
 *             FMIL.fmi_import_free_context(self._context)
 * 
 *         if self._fmu_temp_dir:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._fmu_temp_dir); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4802
 * 
 *         if self._fmu_temp_dir:
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *     def instantiate_slave(self, name = 'Slave', visible = False):
 */
    __pyx_t_2 = PyBytes_AsString(__pyx_v_self->__pyx_base._fmu_temp_dir); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_self->__pyx_base.callbacks), __pyx_t_2);
    goto __pyx_L7;
  }
  __pyx_L7:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5instantiate_slave(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_4instantiate_slave[] = "\n        Instantiate the slave.\n\n        Parameters::\n\n            name --\n                The name of the instance.\n                Default: 'Slave'\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: fmiInstantiateSlave.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5instantiate_slave(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_visible = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__visible,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instantiate_slave (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s__Slave);
    values[1] = __pyx_k_260;
    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_slave") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4804; __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_slave", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4804; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.instantiate_slave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_4instantiate_slave(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_name, __pyx_v_visible);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4804
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 * 
 *     def instantiate_slave(self, name = 'Slave', visible = False):             # <<<<<<<<<<<<<<
 *         """
 *         Instantiate the slave.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_4instantiate_slave(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_visible) {
  fmi2_boolean_t __pyx_v__visible;
  fmi2_string_t __pyx_v_location;
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  fmi2_string_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("instantiate_slave", 0);

  /* "pyfmi\fmi.pyx":4821
 *         """
 * 
 *         cdef FMIL.fmi2_boolean_t _visible = 0             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi2_string_t  location = NULL
 *         cdef int                 status
 */
  __pyx_v__visible = 0;

  /* "pyfmi\fmi.pyx":4822
 * 
 *         cdef FMIL.fmi2_boolean_t _visible = 0
 *         cdef FMIL.fmi2_string_t  location = NULL             # <<<<<<<<<<<<<<
 *         cdef int                 status
 * 
 */
  __pyx_v_location = NULL;

  /* "pyfmi\fmi.pyx":4825
 *         cdef int                 status
 * 
 *         if visible:             # <<<<<<<<<<<<<<
 *             _visible = 1
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_visible); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4826
 * 
 *         if visible:
 *             _visible = 1             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_instantiate_slave(self._fmu, name, location, _visible)
 */
    __pyx_v__visible = 1;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4828
 *             _visible = 1
 * 
 *         status = FMIL.fmi2_import_instantiate_slave(self._fmu, name, location, _visible)             # <<<<<<<<<<<<<<
 * 
 *         if status != FMIL.jm_status_success:
 */
  __pyx_t_2 = PyBytes_AsString(__pyx_v_name); if (unlikely((__pyx_t_2 == (fmi2_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_status = fmi2_import_instantiate_slave(__pyx_v_self->__pyx_base._fmu, __pyx_t_2, __pyx_v_location, __pyx_v__visible);

  /* "pyfmi\fmi.pyx":4830
 *         status = FMIL.fmi2_import_instantiate_slave(self._fmu, name, location, _visible)
 * 
 *         if status != FMIL.jm_status_success:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to instantiate the slave.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != jm_status_success);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4831
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the slave.')             # <<<<<<<<<<<<<<
 * 
 *     def initialize(self, tStart=0.0, tStop=1.0, StopTimeDefined=False, relTol=None):
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_262), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4831; __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 = 4831; __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_AddTraceback("pyfmi.fmi.FMUModelCS2.instantiate_slave", __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_7initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_6initialize[] = "\n        Initializes the slave.\n\n        Parameters::\n\n            tStart --\n                Start time of the simulation.\n                Default: 0.0\n\n            tStop --\n                Stop time of the simulation.\n                Default: 1.0\n\n            StopTimeDefined --\n                Boolen indicating if tStop is defined.\n                Default: False\n\n            relTol --\n                Relative tolerance used in the simulation.\n                Default: None (Default experiment tolerance)\n\n        Calls the low-level FMU function: fmiInstantiateSlave\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_7initialize(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_v_relTol = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__tStart,&__pyx_n_s__tStop,&__pyx_n_s__StopTimeDefined,&__pyx_n_s__relTol,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  {
    PyObject* values[4] = {0,0,0,0};
    values[0] = __pyx_k_263;
    values[1] = __pyx_k_264;
    values[2] = __pyx_k_265;

    /* "pyfmi\fmi.pyx":4833
 *             raise FMUException('Failed to instantiate the slave.')
 * 
 *     def initialize(self, tStart=0.0, tStop=1.0, StopTimeDefined=False, relTol=None):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the slave.
 */
    values[3] = ((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  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__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--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__relTol);
          if (value) { values[3] = 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 = 4833; __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_tStart = values[0];
    __pyx_v_tStop = values[1];
    __pyx_v_StopTimeDefined = values[2];
    __pyx_v_relTol = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("initialize", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4833; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_6initialize(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_tStart, __pyx_v_tStop, __pyx_v_StopTimeDefined, __pyx_v_relTol);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_6initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_tStart, PyObject *__pyx_v_tStop, PyObject *__pyx_v_StopTimeDefined, PyObject *__pyx_v_relTol) {
  int __pyx_v_status;
  fmi2_boolean_t __pyx_v_stopDefined;
  fmi2_real_t __pyx_v_relativeTol;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  fmi2_real_t __pyx_t_4;
  fmi2_real_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialize", 0);

  /* "pyfmi\fmi.pyx":4861
 *         cdef FMIL.fmi2_real_t    relativeTol
 * 
 *         if StopTimeDefined:             # <<<<<<<<<<<<<<
 *             stopDefined = 1
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_StopTimeDefined); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4862
 * 
 *         if StopTimeDefined:
 *             stopDefined = 1             # <<<<<<<<<<<<<<
 *         else:
 *             stopDefined = 0
 */
    __pyx_v_stopDefined = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":4864
 *             stopDefined = 1
 *         else:
 *             stopDefined = 0             # <<<<<<<<<<<<<<
 * 
 *         if relTol is None:
 */
    __pyx_v_stopDefined = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4866
 *             stopDefined = 0
 * 
 *         if relTol is None:             # <<<<<<<<<<<<<<
 *             relativeTol = self.get_default_experiment_tolerance()
 *         else:
 */
  __pyx_t_1 = (__pyx_v_relTol == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4867
 * 
 *         if relTol is None:
 *             relativeTol = self.get_default_experiment_tolerance()             # <<<<<<<<<<<<<<
 *         else:
 *             relativeTol = relTol
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_151); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4867; __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 = 4867; __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_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_relativeTol = __pyx_t_4;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":4869
 *             relativeTol = self.get_default_experiment_tolerance()
 *         else:
 *             relativeTol = relTol             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_relTol); if (unlikely((__pyx_t_4 == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_relativeTol = __pyx_t_4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":4872
 * 
 * 
 *         self.time = tStart             # <<<<<<<<<<<<<<
 *         status = FMIL.fmi2_import_initialize_slave(self._fmu, relativeTol, 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 = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":4873
 * 
 *         self.time = tStart
 *         status = FMIL.fmi2_import_initialize_slave(self._fmu, relativeTol, tStart, stopDefined, tStop)             # <<<<<<<<<<<<<<
 * 
 *         if status != FMIL.fmi2_status_ok:
 */
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_tStart); if (unlikely((__pyx_t_4 == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tStop); if (unlikely((__pyx_t_5 == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_status = fmi2_import_initialize_slave(__pyx_v_self->__pyx_base._fmu, __pyx_v_relativeTol, __pyx_t_4, __pyx_v_stopDefined, __pyx_t_5);

  /* "pyfmi\fmi.pyx":4875
 *         status = FMIL.fmi2_import_initialize_slave(self._fmu, relativeTol, tStart, stopDefined, tStop)
 * 
 *         if status != FMIL.fmi2_status_ok:             # <<<<<<<<<<<<<<
 *             raise FMUException("The slave failed to initialize.")
 * 
 */
  __pyx_t_1 = (__pyx_v_status != fmi2_status_ok);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4876
 * 
 *         if status != FMIL.fmi2_status_ok:
 *             raise FMUException("The slave failed to initialize.")             # <<<<<<<<<<<<<<
 * 
 *         self._allocated_fmu = True
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_267), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4876; __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 = 4876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":4878
 *             raise FMUException("The slave failed to initialize.")
 * 
 *         self._allocated_fmu = True             # <<<<<<<<<<<<<<
 * 
 *     def reset_slave(self):
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._allocated_fmu);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._allocated_fmu);
  __pyx_v_self->__pyx_base._allocated_fmu = __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.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_11FMUModelCS2_9reset_slave(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_8reset_slave[] = "\n        Function called by the master after a simulation before\n        starting a new one. Note that the envoronment has to initialize\n        the FMU again after this function-call.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_9reset_slave(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_slave (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_8reset_slave(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4880
 *         self._allocated_fmu = True
 * 
 *     def reset_slave(self):             # <<<<<<<<<<<<<<
 *         """
 *         Function called by the master after a simulation before
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_8reset_slave(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("reset_slave", 0);

  /* "pyfmi\fmi.pyx":4889
 *         cdef int status
 * 
 *         status = FMIL.fmi2_import_reset_slave(self._fmu)             # <<<<<<<<<<<<<<
 *         if status != 0:
 *             raise FMUException('An error occured when reseting the slave, see the log for possible more information')
 */
  __pyx_v_status = fmi2_import_reset_slave(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":4890
 * 
 *         status = FMIL.fmi2_import_reset_slave(self._fmu)
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured when reseting the slave, see the log for possible more information')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4891
 *         status = FMIL.fmi2_import_reset_slave(self._fmu)
 *         if status != 0:
 *             raise FMUException('An error occured when reseting the slave, 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 = 4891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_269), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4891; __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 = 4891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4894
 * 
 *         #Default values
 *         self.__t = None             # <<<<<<<<<<<<<<
 * 
 *         #Internal values
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __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 = Py_None;

  /* "pyfmi\fmi.pyx":4897
 * 
 *         #Internal values
 *         self._log = []             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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 = __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.FMUModelCS2.reset_slave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4900
 * 
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current time of the simulation.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_11_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 overriden 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 = 4900; __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_11_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 = 4900; __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":4907
 *             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_11_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_10_get_time[] = "\n        Returns the current time of the simulation.\n\n        Returns::\n            The time.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_11_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_10_get_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4900
 * 
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current time of the simulation.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_10_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 = 4900; __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":4909
 *         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_13_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 overriden 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 = 4909; __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_13_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 = 4909; __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 = 4909; __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 = 4909; __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":4917
 *                 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 = 4917; __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_13_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_12_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_13_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 = 4909; __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_12_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":4909
 *         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_12_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 = 4909; __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_15do_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_14do_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 fmiDoStep.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_15do_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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__current_t,&__pyx_n_s__step_size,&__pyx_n_s__new_step,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_step (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    values[2] = __pyx_k_270;
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__current_t);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__step_size);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_step", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4927; __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 = 4927; __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 = 4927; __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 = 4927; __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 = 4927; __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_14do_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":4927
 * 
 * 
 *     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_14do_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":4956
 *         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 = 4956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

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

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

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

  /* "pyfmi\fmi.pyx":4963
 *         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":4965
 *         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 = 4965; __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_17cancel_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_16cancel_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            -fmiTerminateSlave\n            -fmiResetSlave\n            -fmiFreeSlaveInstance\n        are allowed\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_17cancel_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_16cancel_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4967
 *         return status
 * 
 *     def cancel_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         Cancel a current integrator step. Can only be called if the
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_16cancel_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":4981
 *         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":4982
 * 
 *         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":4983
 *         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 = 4983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_272), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4983; __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 = 4983; __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_19set_input_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_18set_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_19set_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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variables,&__pyx_n_s__values,&__pyx_n_s__order,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_derivatives (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variables);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__order);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4986; __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 = 4986; __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 = 4986; __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 = 4986; __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_18set_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":4986
 * 
 * 
 *     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_18set_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;
  char *__pyx_t_15;
  fmi2_value_reference_t __pyx_t_16;
  long __pyx_t_17;
  PyObject *(*__pyx_t_18)(PyObject *);
  int __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  size_t __pyx_t_22;
  size_t __pyx_t_23;
  size_t __pyx_t_24;
  size_t __pyx_t_25;
  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":5007
 *         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 = 5007; __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 = 5007; __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 = 5007; __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 = 5007; __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 = 5007; __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 = 5007; __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 = 5007; __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 = 5007; __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 = 5007; __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 = 5007; __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 = 5007; __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 = 5007; __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 = 5007; __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":5009
 *         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 = 5009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

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

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

  /* "pyfmi\fmi.pyx":5020
 *             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_4 = ((PyObject *)((PyObject*)(&PyString_Type)));
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_13 = __Pyx_TypeCheck(__pyx_v_variables, __pyx_t_4); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_13) {

    /* "pyfmi\fmi.pyx":5021
 * 
 *         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 = 5021; __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 = 5021; __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 = 5021; __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 = 5021; __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 = 5021; __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 = 5021; __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 = 5021; __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 = 5021; __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 = 5021; __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 = 5021; __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 = 5021; __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 = 5021; __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 = 5021; __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 = 5021; __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":5022
 *         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 = PyBytes_AsString(__pyx_v_variables); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((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_15, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_17 = 0;
    __pyx_t_9 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_17 >= __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 = 5022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi2_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_L5;
  }

  /* "pyfmi\fmi.pyx":5023
 *             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_2 = ((PyObject *)((PyObject*)(&PyList_Type)));
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_13 = __Pyx_TypeCheck(__pyx_v_variables, __pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  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 = 5023; __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 = 5023; __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 = 5023; __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_18 = 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 = 5023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_18 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_18 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++;
      } else if (!__pyx_t_18 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++;
      } else {
        __pyx_t_5 = __pyx_t_18(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __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 = 5023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = ((PyObject *)((PyObject*)(&PyString_Type)));
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_19 = __Pyx_TypeCheck(__pyx_v_v, __pyx_t_3); 
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
      if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __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 = 5023; __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 = 5023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_21 = __pyx_t_19;
  } else {
    __pyx_t_21 = __pyx_t_13;
  }
  if (__pyx_t_21) {

    /* "pyfmi\fmi.pyx":5024
 *             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 = 5024; __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 = 5024; __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 = 5024; __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 = 5024; __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 = 5024; __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 = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_20 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__uint32); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_20 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_20, __pyx_n_s__flatten); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __pyx_t_20 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_20);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_20);
    __pyx_t_20 = 0;

    /* "pyfmi\fmi.pyx":5025
 *         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_22 = __pyx_v_nref;
    for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
      __pyx_v_i = __pyx_t_23;

      /* "pyfmi\fmi.pyx":5026
 *             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_20 = __Pyx_GetItemInt(__pyx_v_variables, __pyx_v_i, sizeof(size_t)+1, __Pyx_PyInt_to_py_size_t); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_15 = PyBytes_AsString(__pyx_t_20); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_16 = ((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_15, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (unlikely(__pyx_t_24 >= (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 = 5026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi2_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_16;

      /* "pyfmi\fmi.pyx":5027
 *             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_25 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (unlikely(__pyx_t_25 >= (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 = 5027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi2_integer_t *, __pyx_pybuffernd_orders.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_orders.diminfo[0].strides) = __pyx_v_order;
    }
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5029
 *                 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_20 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __pyx_t_2 = PyObject_Call(__pyx_t_20, ((PyObject *)__pyx_k_tuple_275), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5032
 * 
 *         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":5034
 *                                                                 <FMIL.fmi2_integer_t*> orders.data, <FMIL.fmi2_real_t*> val.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Real input derivatives.')
 * 
 */
  __pyx_t_21 = (__pyx_v_status != 0);
  if (__pyx_t_21) {

    /* "pyfmi\fmi.pyx":5035
 * 
 *         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 = 5035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_20 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_276), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_20, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L10;
  }
  __pyx_L10:;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_21get_output_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_20get_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_21get_output_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variables = 0;
  fmi2_integer_t __pyx_v_order;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variables,&__pyx_n_s__order,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_output_derivatives (wrapper)", 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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variables);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__order);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_output_derivatives", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5037; __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 = 5037; __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 = 5037; __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 = 5037; __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_20get_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":5037
 *             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_20get_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;
  char *__pyx_t_15;
  fmi2_value_reference_t __pyx_t_16;
  long __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  PyObject *(*__pyx_t_19)(PyObject *);
  PyObject *__pyx_t_20 = NULL;
  size_t __pyx_t_21;
  size_t __pyx_t_22;
  size_t __pyx_t_23;
  size_t __pyx_t_24;
  PyArrayObject *__pyx_t_25 = 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":5063
 * 
 * 
 *         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":5065
 *         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":5066
 * 
 *         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 = 5066; __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 = 5066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_94), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5066; __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 = 5066; __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 = 5066; __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 = 5066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5068
 *             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_6 = ((PyObject *)((PyObject*)(&PyString_Type)));
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_variables, __pyx_t_6); 
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":5069
 * 
 *         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":5070
 *         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 = 5070; __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 = 5070; __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 = 5070; __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 = 5070; __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 = 5070; __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 = 5070; __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 = 5070; __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 = 5070; __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 = 5070; __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 = 5070; __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 = 5070; __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 = 5070; __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 = 5070; __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 = 5070; __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":5071
 *             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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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 = 5071; __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":5072
 *             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 = PyBytes_AsString(__pyx_v_variables); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((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_15, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_17 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_17 >= __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 = 5072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi2_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_L4;
  }

  /* "pyfmi\fmi.pyx":5073
 *             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_7 = ((PyObject *)((PyObject*)(&PyList_Type)));
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_variables, __pyx_t_7); 
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  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 = 5073; __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 = 5073; __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 = 5073; __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_18 = 0;
      __pyx_t_19 = NULL;
    } else {
      __pyx_t_18 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_19 = Py_TYPE(__pyx_t_8)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_19 && PyList_CheckExact(__pyx_t_8)) {
        if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_8)) break;
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_18); __Pyx_INCREF(__pyx_t_6); __pyx_t_18++;
      } else if (!__pyx_t_19 && PyTuple_CheckExact(__pyx_t_8)) {
        if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_18); __Pyx_INCREF(__pyx_t_6); __pyx_t_18++;
      } else {
        __pyx_t_6 = __pyx_t_19(__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 = 5073; __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 = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = ((PyObject *)((PyObject*)(&PyString_Type)));
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_v, __pyx_t_5); 
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __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_20)); __pyx_t_20 = 0;
      if (unlikely(PyList_Append(__pyx_t_7, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __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 = 5073; __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 = 5073; __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 = 5073; __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":5074
 *             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_18 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_nref = __pyx_t_18;

    /* "pyfmi\fmi.pyx":5075
 *         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 = 5075; __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 = 5075; __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 = 5075; __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 = 5075; __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 = 5075; __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 = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_20 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__uint32); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_20 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __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_20, __pyx_n_s__flatten); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __pyx_t_20 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_20);
    {
      __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 = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_20);
    __pyx_t_20 = 0;

    /* "pyfmi\fmi.pyx":5076
 *             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_20 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_20, __pyx_n_s__array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __pyx_t_20 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    { 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_20, __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 = 5076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_20));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_20));
    __pyx_t_20 = 0;
    __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_20));
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5076; __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 = 5076; __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_20, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5076; __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_20)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5076; __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_20)); __pyx_t_20 = 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 = 5076; __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 = 5076; __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":5077
 *             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_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":5078
 *             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 = 5078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_15 = PyBytes_AsString(__pyx_t_5); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_16 = ((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_15, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (unlikely(__pyx_t_23 >= (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 = 5078; __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_16;

      /* "pyfmi\fmi.pyx":5079
 *             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_10 = -1;
      if (unlikely(__pyx_t_24 >= (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 = 5079; __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_L4;
  }
  /*else*/ {

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

  /* "pyfmi\fmi.pyx":5083
 *             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_20 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_20, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __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 = 5083; __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_20);
      PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_20);
      __Pyx_GIVEREF(__pyx_t_20);
    }
  }
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  PyTuple_SET_ITEM(__pyx_t_20, 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 = 5083; __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 = 5083; __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 = 5083; __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 = 5083; __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 = 5083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_20), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5083; __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_20)); __pyx_t_20 = 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 = 5083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_25 = ((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_25, &__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 = 5083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_25 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

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

  /* "pyfmi\fmi.pyx":5091
 *             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_20);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_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_23get_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_22get_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                fmiDoStepStatus       = 0\n                fmiPendingStatus      = 1\n                fmiLastSuccessfulTime = 2\n                fmiTerminated         = 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_23get_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_22get_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5094
 * 
 * 
 *     def get_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the fmi-status for the the specified fmi-staus-kind.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_22get_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":5121
 *         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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __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":5122
 * 
 *         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 = 5122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

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

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

  /* "pyfmi\fmi.pyx":5130
 *             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 = 5130; __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_25get_real_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_24get_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_25get_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_24get_real_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5132
 *         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_24get_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":5153
 *         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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __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 = 5153; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __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 = 5153; __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":5154
 * 
 *         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 = 5154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

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

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

  /* "pyfmi\fmi.pyx":5163
 *             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 = 5163; __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_27get_integer_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_26get_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_27get_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_26get_integer_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5165
 *         return output
 * 
 *     def get_integer_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a integer-value,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_26get_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":5186
 *         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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5186; __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 = 5186; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5186; __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 = 5186; __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":5187
 * 
 *         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 = 5187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

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

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

  /* "pyfmi\fmi.pyx":5196
 *             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 = 5196; __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_29get_boolean_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_28get_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_29get_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_28get_boolean_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5198
 *         return output
 * 
 *     def get_boolean_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a boolean-value,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_28get_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":5219
 *         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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5219; __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 = 5219; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5219; __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 = 5219; __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":5220
 * 
 *         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 = 5220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

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

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

  /* "pyfmi\fmi.pyx":5229
 *             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 = 5229; __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_31get_string_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_30get_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_31get_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_30get_string_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5231
 *         return output
 * 
 *     def get_string_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a string-value,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_30get_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":5252
 *         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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_3, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

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

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

  /* "pyfmi\fmi.pyx":5258
 * 
 * 
 *         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":5259
 * 
 *         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":5260
 *         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 = 5260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_290), NULL); 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);
    __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 = 5260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5262
 *             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 = 5262; __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_33simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_32simulate[] = "\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: 0.0\n\n            final_time --\n                Final time for the simulation.\n                Default: 1.0\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 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 ob""ject.\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_33simulate(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;
  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 *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 0);
  {
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = __pyx_k_291;
    values[1] = __pyx_k_292;

    /* "pyfmi\fmi.pyx":5268
 *                  start_time=0.0,
 *                  final_time=1.0,
 *                  input=(),             # <<<<<<<<<<<<<<
 *                  algorithm='FMICSAlg',
 *                  options={}):
 */
    values[2] = ((PyObject *)__pyx_empty_tuple);
    values[3] = ((PyObject *)__pyx_n_s__FMICSAlg);
    values[4] = __pyx_k_293;
    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 = 5265; __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 = 5265; __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_32simulate(((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":5265
 * 
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time=0.0,
 *                  final_time=1.0,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_32simulate(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;
  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", 0);

  /* "pyfmi\fmi.pyx":5326
 *             Result object, subclass of common.algorithm_drivers.ResultBase.
 *         """
 *         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_111); 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);

  /* "pyfmi\fmi.pyx":5331
 *                                              'pyfmi.fmi_algorithm_drivers',
 *                                              algorithm,
 *                                              options)             # <<<<<<<<<<<<<<
 * 
 *     def simulate_options(self, algorithm='FMICSAlg'):
 */
  __pyx_t_2 = PyTuple_New(6); 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_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_kp_s_112));
  PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_kp_s_112));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_112));
  __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 = 5326; __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", __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_35simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_34simulate_options[] = "\n        Get an instance of the simulate options class, prefilled 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_35simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__algorithm,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 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 = 5333; __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 = 5333; __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_34simulate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_algorithm);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5333
 *                                              options)
 * 
 *     def simulate_options(self, algorithm='FMICSAlg'):             # <<<<<<<<<<<<<<
 *         """
 *         Get an instance of the simulate options class, prefilled with default
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_34simulate_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":5350
 *             Options class for the algorithm specified with default values.
 *         """
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)             # <<<<<<<<<<<<<<
 * 
 * cdef class FMUModelME2(FMUModelBase2):
 */
  __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 = 5350; __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 = 5350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_112));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_112));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_112));
  __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 = 5350; __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 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        ";
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelME2___init__;
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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,&__pyx_n_s__log_file_name,0};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_13);
    values[2] = __pyx_k_294;
    values[3] = ((PyObject *)__pyx_kp_s_6);
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[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, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5357; __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("__init__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5357; __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5357
 *     """
 * 
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = ""):             # <<<<<<<<<<<<<<
 *         """
 *         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) {
  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":5383
 *         """
 *         #Call super
 *         FMUModelBase2.__init__(self, fmu, path, enable_logging, log_file_name)             # <<<<<<<<<<<<<<
 * 
 *         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 = 5383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5383; __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_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5383; __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":5385
 *         FMUModelBase2.__init__(self, fmu, path, enable_logging, log_file_name)
 * 
 *         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":5386
 * 
 *         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":5387
 *         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()['me_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 = 5387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_296), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5387; __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 = 5387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5389
 *                 raise FMUException('This class only supports FMI 2.0 for Model Exchange.')
 * 
 *         if self.get_capability_flags()['me_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_257); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5389; __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 = 5389; __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_230)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5389; __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 = 5389; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5389; __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_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5390
 * 
 *         if self.get_capability_flags()['me_needsExecutionTool'] == True:
 *             raise FMUException('Models that need an execution tool are not supported')             # <<<<<<<<<<<<<<
 * 
 *         self._modelId = FMIL.fmi2_import_get_model_identifier_ME(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 = 5390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_297), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5390; __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 = 5390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5392
 *             raise FMUException('Models that need an execution tool are not supported')
 * 
 *         self._modelId = FMIL.fmi2_import_get_model_identifier_ME(self._fmu)             # <<<<<<<<<<<<<<
 *         self.instantiate_model()
 * 
 */
  __pyx_v_self->__pyx_base._modelId = fmi2_import_get_model_identifier_ME(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":5393
 * 
 *         self._modelId = FMIL.fmi2_import_get_model_identifier_ME(self._fmu)
 *         self.instantiate_model()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__instantiate_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5393; __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 = 5393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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":5395
 *         self.instantiate_model()
 * 
 *     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;
  char *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyfmi\fmi.pyx":5400
 *         """
 * 
 *         if self._allocated_fmu:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_terminate(self._fmu)
 *             FMIL.fmi2_import_free_model_instance(self._fmu)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_fmu); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5401
 * 
 *         if self._allocated_fmu:
 *             FMIL.fmi2_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free_model_instance(self._fmu)
 * 
 */
    fmi2_import_terminate(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":5402
 *         if self._allocated_fmu:
 *             FMIL.fmi2_import_terminate(self._fmu)
 *             FMIL.fmi2_import_free_model_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll:
 */
    fmi2_import_free_model_instance(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5404
 *             FMIL.fmi2_import_free_model_instance(self._fmu)
 * 
 *         if self._allocated_dll:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_dll); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5405
 * 
 *         if self._allocated_dll:
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_xml:
 */
    fmi2_import_destroy_dllfmu(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5407
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 *         if self._allocated_xml:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free(self._fmu)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_xml); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5408
 * 
 *         if self._allocated_xml:
 *             FMIL.fmi2_import_free(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_context:
 */
    fmi2_import_free(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5410
 *             FMIL.fmi2_import_free(self._fmu)
 * 
 *         if self._allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(self._context)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_context); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5411
 * 
 *         if self._allocated_context:
 *             FMIL.fmi_import_free_context(self._context)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_temp_dir:
 */
    fmi_import_free_context(__pyx_v_self->__pyx_base._context);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":5413
 *             FMIL.fmi_import_free_context(self._context)
 * 
 *         if self._fmu_temp_dir:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._fmu_temp_dir); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5414
 * 
 *         if self._fmu_temp_dir:
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = PyBytes_AsString(__pyx_v_self->__pyx_base._fmu_temp_dir); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_self->__pyx_base.callbacks), __pyx_t_2);
    goto __pyx_L7;
  }
  __pyx_L7:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5instantiate_model(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_4instantiate_model[] = "\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: fmiInstantiateModel.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5instantiate_model(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_visible = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__visible,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instantiate_model (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s__Model);
    values[1] = __pyx_k_298;
    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_model") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5417; __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_model", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5417; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.instantiate_model", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_4instantiate_model(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_name, __pyx_v_visible);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_4instantiate_model(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_visible) {
  fmi2_boolean_t __pyx_v_vis;
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  fmi2_string_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("instantiate_model", 0);

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

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

    /* "pyfmi\fmi.pyx":5441
 *             vis = 1
 *         else:
 *             vis = 0             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_instantiate_model(self._fmu, name, NULL, vis)
 */
    __pyx_v_vis = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5443
 *             vis = 0
 * 
 *         status = FMIL.fmi2_import_instantiate_model(self._fmu, name, NULL, vis)             # <<<<<<<<<<<<<<
 * 
 *         if status != FMIL.jm_status_success:
 */
  __pyx_t_2 = PyBytes_AsString(__pyx_v_name); if (unlikely((__pyx_t_2 == (fmi2_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_status = fmi2_import_instantiate_model(__pyx_v_self->__pyx_base._fmu, __pyx_t_2, NULL, __pyx_v_vis);

  /* "pyfmi\fmi.pyx":5445
 *         status = FMIL.fmi2_import_instantiate_model(self._fmu, name, NULL, vis)
 * 
 *         if status != FMIL.jm_status_success:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to instantiate the model.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != jm_status_success);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5446
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the model.')             # <<<<<<<<<<<<<<
 * 
 *     def initialize(self, tolControlled = True, relativeTolerance = None):
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_300), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5446; __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 = 5446; __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_AddTraceback("pyfmi.fmi.FMUModelME2.instantiate_model", __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_7initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_6initialize[] = "\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                Default: True\n\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                Default: None (default tolerance)\n\n        Calls the low-level FMI function: fmiInitialize.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_7initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_tolControlled = 0;
  PyObject *__pyx_v_relativeTolerance = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__tolControlled,&__pyx_n_s__relativeTolerance,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    values[0] = __pyx_k_301;

    /* "pyfmi\fmi.pyx":5448
 *             raise FMUException('Failed to instantiate the model.')
 * 
 *     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 = 5448; __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 = 5448; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_6initialize(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_tolControlled, __pyx_v_relativeTolerance);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_6initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_tolControlled, PyObject *__pyx_v_relativeTolerance) {
  fmi2_boolean_t __pyx_v_tolerance_controlled;
  fmi2_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;
  fmi2_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":5473
 * 
 *         #Trying to set the initial time from the xml file, else 0.0
 *         if self.time == None:             # <<<<<<<<<<<<<<
 *             self.time = FMIL.fmi2_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 = 5473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":5474
 *         #Trying to set the initial time from the xml file, else 0.0
 *         if self.time == None:
 *             self.time = FMIL.fmi2_import_get_default_experiment_start(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if tolControlled:
 */
    __pyx_t_2 = PyFloat_FromDouble(fmi2_import_get_default_experiment_start(__pyx_v_self->__pyx_base._fmu)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5474; __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 = 5474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

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

    /* "pyfmi\fmi.pyx":5477
 * 
 *         if tolControlled:
 *             tolerance_controlled = 1             # <<<<<<<<<<<<<<
 *             if relativeTolerance == None:
 *                 tolerance = FMIL.fmi2_import_get_default_experiment_tolerance(self._fmu)
 */
    __pyx_v_tolerance_controlled = 1;

    /* "pyfmi\fmi.pyx":5478
 *         if tolControlled:
 *             tolerance_controlled = 1
 *             if relativeTolerance == None:             # <<<<<<<<<<<<<<
 *                 tolerance = FMIL.fmi2_import_get_default_experiment_tolerance(self._fmu)
 *             else:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_relativeTolerance, Py_None, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5478; __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 = 5478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":5479
 *             tolerance_controlled = 1
 *             if relativeTolerance == None:
 *                 tolerance = FMIL.fmi2_import_get_default_experiment_tolerance(self._fmu)             # <<<<<<<<<<<<<<
 *             else:
 *                 tolerance = relativeTolerance
 */
      __pyx_v_tolerance = fmi2_import_get_default_experiment_tolerance(__pyx_v_self->__pyx_base._fmu);
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":5481
 *                 tolerance = FMIL.fmi2_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 == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_tolerance = __pyx_t_4;
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  /*else*/ {

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

    /* "pyfmi\fmi.pyx":5484
 *         else:
 *             tolerance_controlled = 0
 *             tolerance = 0.0             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_initialize_model(self._fmu, tolerance_controlled, tolerance, &self._eventInfo)
 */
    __pyx_v_tolerance = 0.0;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5486
 *             tolerance = 0.0
 * 
 *         status = FMIL.fmi2_import_initialize_model(self._fmu, tolerance_controlled, tolerance, &self._eventInfo)             # <<<<<<<<<<<<<<
 * 
 *         if status == 1:
 */
  __pyx_v_status = fmi2_import_initialize_model(__pyx_v_self->__pyx_base._fmu, __pyx_v_tolerance_controlled, __pyx_v_tolerance, (&__pyx_v_self->__pyx_base._eventInfo));

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

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

      /* "pyfmi\fmi.pyx":5494
 *                     ' 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 = 5494; __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 = 5494; __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_303), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5494; __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":5497
 *                     ' 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":5498
 * 
 *         if status > 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException(
 *                     'Initialize returned with a 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 = 5498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":5499
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with a 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 = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_304), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5499; __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 = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":5503
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Initialize returned with a 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 = 5503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_305), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5503; __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 = 5503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L9:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":5506
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 *         self._allocated_fmu = True             # <<<<<<<<<<<<<<
 * 
 *     def reset(self):
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._allocated_fmu);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._allocated_fmu);
  __pyx_v_self->__pyx_base._allocated_fmu = __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.FMUModelME2.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_11FMUModelME2_9reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_8reset[] = "\n        This metod resets the FMU by first calling fmiTerminate and\n        fmiFreeModelInstance and then reloades the DLL and finally\n        reinstantiates using fmiInstantiateModel.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_9reset(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_11FMUModelME2_8reset(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5508
 *         self._allocated_fmu = True
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         This metod resets the FMU by first calling fmiTerminate and
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_8reset(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("reset", 0);

  /* "pyfmi\fmi.pyx":5514
 *         reinstantiates using fmiInstantiateModel.
 *         """
 *         if self._allocated_fmu:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_terminate(self._fmu)
 *             FMIL.fmi2_import_free_model_instance(self._fmu)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_fmu); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5515
 *         """
 *         if self._allocated_fmu:
 *             FMIL.fmi2_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free_model_instance(self._fmu)
 * 
 */
    fmi2_import_terminate(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":5516
 *         if self._allocated_fmu:
 *             FMIL.fmi2_import_terminate(self._fmu)
 *             FMIL.fmi2_import_free_model_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll:
 */
    fmi2_import_free_model_instance(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5518
 *             FMIL.fmi2_import_free_model_instance(self._fmu)
 * 
 *         if self._allocated_dll:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_dll); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5519
 * 
 *         if self._allocated_dll:
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_create_dllfmu(self._fmu, self._fmu_kind, &self.callBackFunctions)
 */
    fmi2_import_destroy_dllfmu(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5521
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 *         status = FMIL.fmi2_import_create_dllfmu(self._fmu, self._fmu_kind, &self.callBackFunctions)             # <<<<<<<<<<<<<<
 *         if status == FMIL.jm_status_error:
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")
 */
  __pyx_v_status = fmi2_import_create_dllfmu(__pyx_v_self->__pyx_base._fmu, __pyx_v_self->__pyx_base._fmu_kind, (&__pyx_v_self->__pyx_base.callBackFunctions));

  /* "pyfmi\fmi.pyx":5522
 * 
 *         status = FMIL.fmi2_import_create_dllfmu(self._fmu, self._fmu_kind, &self.callBackFunctions)
 *         if status == FMIL.jm_status_error:             # <<<<<<<<<<<<<<
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")
 * 
 */
  __pyx_t_1 = (__pyx_v_status == jm_status_error);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5523
 *         status = FMIL.fmi2_import_create_dllfmu(self._fmu, self._fmu_kind, &self.callBackFunctions)
 *         if status == FMIL.jm_status_error:
 *             raise FMUException("The DLL could not be reloaded, check the log for 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 = 5523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_306), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5523; __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 = 5523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5526
 * 
 *         #Default values
 *         self.__t = None             # <<<<<<<<<<<<<<
 * 
 *         #Internal values
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __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 = Py_None;

  /* "pyfmi\fmi.pyx":5529
 * 
 *         #Internal values
 *         self._log = []             # <<<<<<<<<<<<<<
 * 
 *         #Instantiates the model
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5529; __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 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":5532
 * 
 *         #Instantiates the model
 *         self.instantiate_model()             # <<<<<<<<<<<<<<
 * 
 *     def terminate(self):
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__instantiate_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5532; __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 = 5532; __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_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.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_11FMUModelME2_11terminate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_10terminate[] = "\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_11FMUModelME2_11terminate(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_11FMUModelME2_10terminate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5534
 *         self.instantiate_model()
 * 
 *     def terminate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the FMI function fmiTerminate() on the FMU.
 */

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

  /* "pyfmi\fmi.pyx":5539
 *         After this call, any call to a function changing the state of the FMU will fail.
 *         """
 *         FMIL.fmi2_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  fmi2_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;
}

/* "pyfmi\fmi.pyx":5542
 * 
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current time of the simulation.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_13_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 overriden 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 = 5542; __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_13_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 = 5542; __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":5549
 *             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_13_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_12_get_time[] = "\n        Returns the current time of the simulation.\n\n        Returns::\n            The time.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_13_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_12_get_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5542
 * 
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current time of the simulation.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_12_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 = 5542; __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":5551
 *         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_15_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 overriden 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 = 5551; __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_15_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 = 5551; __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 = 5551; __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 = 5551; __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":5561
 * 
 *         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":5563
 *         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":5564
 * 
 *         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 = 5564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_307), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5564; __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 = 5564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5565
 *         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 = 5565; __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_15_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_14_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_15_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 = 5551; __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_14_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":5551
 *         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_14_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 = 5551; __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_17get_event_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_16get_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_11FMUModelME2_17get_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_16get_event_info(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5574
 * 
 * 
 *     def get_event_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event information from the FMU.
 */

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

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

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

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

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

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

  /* "pyfmi\fmi.pyx":5613
 *         self._pyEventInfo.nextEventTime               = self._eventInfo.nextEventTime
 * 
 *         return self._pyEventInfo             # <<<<<<<<<<<<<<
 * 
 *     def get_event_indicators(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_19get_event_indicators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_18get_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_19get_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_18get_event_indicators(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5615
 *         return self._pyEventInfo
 * 
 *     def get_event_indicators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event indicators at the current time-point.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_18get_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":5631
 *         """
 *         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 = 5631; __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 = 5631; __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 = 5631; __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 = 5631; __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 = 5631; __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 = 5631; __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 = 5631; __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 = 5631; __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 = 5631; __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 = 5631; __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 = 5631; __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":5633
 *         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":5635
 *         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":5636
 * 
 *         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 = 5636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_308), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5636; __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 = 5636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5638
 *             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_21event_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_20event_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_11FMUModelME2_21event_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_intermediateResult = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__intermediateResult,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("event_update (wrapper)", 0);
  {
    PyObject* values[1] = {0};
    values[0] = __pyx_k_309;
    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 = 5640; __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 = 5640; __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_20event_update(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_intermediateResult);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5640
 *         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_20event_update(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_intermediateResult) {
  int __pyx_v_status;
  fmi2_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("event_update", 0);

  /* "pyfmi\fmi.pyx":5663
 *         cdef FMIL.fmi2_boolean_t intermediate_result
 * 
 *         if intermediateResult:             # <<<<<<<<<<<<<<
 *             intermediate_result = 1
 *             status = FMIL.fmi2_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 = 5663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5664
 * 
 *         if intermediateResult:
 *             intermediate_result = 1             # <<<<<<<<<<<<<<
 *             status = FMIL.fmi2_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)
 *         else:
 */
    __pyx_v_intermediate_result = 1;

    /* "pyfmi\fmi.pyx":5665
 *         if intermediateResult:
 *             intermediate_result = 1
 *             status = FMIL.fmi2_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)             # <<<<<<<<<<<<<<
 *         else:
 *             intermediate_result = 0
 */
    __pyx_v_status = fmi2_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":5667
 *             status = FMIL.fmi2_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)
 *         else:
 *             intermediate_result = 0             # <<<<<<<<<<<<<<
 *             status = FMIL.fmi2_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)
 * 
 */
    __pyx_v_intermediate_result = 0;

    /* "pyfmi\fmi.pyx":5668
 *         else:
 *             intermediate_result = 0
 *             status = FMIL.fmi2_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
    __pyx_v_status = fmi2_import_eventUpdate(__pyx_v_self->__pyx_base._fmu, __pyx_v_intermediate_result, (&__pyx_v_self->__pyx_base._eventInfo));
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5670
 *             status = FMIL.fmi2_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to update the events.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5671
 * 
 *         if status != 0:
 *             raise FMUException('Failed to update the events.')             # <<<<<<<<<<<<<<
 * 
 *     def get_tolerances(self):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_310), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_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.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_23get_tolerances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_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_11FMUModelME2_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_11FMUModelME2_22get_tolerances(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5673
 *             raise FMUException('Failed to update the events.')
 * 
 *     def get_tolerances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the relative and absolute tolerances. If the relative tolerance
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_22get_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":5694
 *         """
 * 
 *         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_151); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5694; __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 = 5694; __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":5695
 * 
 *         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 = 5695; __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 = 5695; __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_152); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_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":5697
 *         atol = 0.01*rtol*self.nominal_continuous_states
 * 
 *         return [rtol, atol]             # <<<<<<<<<<<<<<
 * 
 *     cpdef completed_event_iteration(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5697; __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;
}

/* "pyfmi\fmi.pyx":5699
 *         return [rtol, atol]
 * 
 *     cpdef completed_event_iteration(self):             # <<<<<<<<<<<<<<
 *         """
 *         This function has to be called by the solver when the global
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_25completed_event_iteration(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME2_completed_event_iteration(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, int __pyx_skip_dispatch) {
  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("completed_event_iteration", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden 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_311); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5699; __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_25completed_event_iteration)) {
      __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 = 5699; __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":5707
 *         cdef int status
 * 
 *         status = FMIL.fmi2_import_completed_event_iteration(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_completed_event_iteration(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":5709
 *         status = FMIL.fmi2_import_completed_event_iteration(self._fmu)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured when updating FMU after global event iteration has converged ')
 * 
 */
  __pyx_t_3 = (__pyx_v_status != 0);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":5710
 * 
 *         if status != 0:
 *             raise FMUException('An error occured when updating FMU after global event iteration has converged ')             # <<<<<<<<<<<<<<
 * 
 *         return status
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_313), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5710; __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 = 5710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5712
 *             raise FMUException('An error occured when updating FMU after global event iteration has converged ')
 * 
 *         return status             # <<<<<<<<<<<<<<
 * 
 *     def completed_integrator_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 = 5712; __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_AddTraceback("pyfmi.fmi.FMUModelME2.completed_event_iteration", __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_25completed_event_iteration(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_24completed_event_iteration[] = "\n        This function has to be called by the solver when the global\n        event iteration has converged.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_25completed_event_iteration(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("completed_event_iteration (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_24completed_event_iteration(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5699
 *         return [rtol, atol]
 * 
 *     cpdef completed_event_iteration(self):             # <<<<<<<<<<<<<<
 *         """
 *         This function has to be called by the solver when the global
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_24completed_event_iteration(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("completed_event_iteration", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->completed_event_iteration(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5699; __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.completed_event_iteration", __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_27completed_integrator_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_26completed_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_11FMUModelME2_27completed_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_11FMUModelME2_26completed_integrator_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5714
 *         return status
 * 
 *     def completed_integrator_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         This method must be called by the environment after every completed step
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_26completed_integrator_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  int __pyx_v_status;
  fmi2_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":5730
 *         cdef FMIL.fmi2_boolean_t callEventUpdate
 * 
 *         status = FMIL.fmi2_import_completed_integrator_step(self._fmu, &callEventUpdate)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_completed_integrator_step(__pyx_v_self->__pyx_base._fmu, (&__pyx_v_callEventUpdate));

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

  /* "pyfmi\fmi.pyx":5735
 *             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":5736
 * 
 *         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 = 5736; __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":5738
 *             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 = 5738; __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.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_29_get_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_28_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_29_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_28_get_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5741
 * 
 * 
 *     def _get_continuous_states(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a vector with the values of the continuous states.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_28_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":5750
 *         """
 *         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 = 5750; __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 = 5750; __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 = 5750; __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 = 5750; __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 = 5750; __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 = 5750; __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 = 5750; __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 = 5750; __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 = 5750; __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 = 5750; __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 = 5750; __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":5751
 *         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":5753
 *         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":5754
 * 
 *         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 = 5754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_315), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5754; __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 = 5754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5756
 *             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_31_set_continuous_states(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_30_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_31_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 = 5758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_30_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":5758
 *         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_30_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 = 5758; __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":5768
 *         """
 *         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 = 5768; __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":5770
 *         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 = 5770; __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 = 5770; __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); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5770; __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_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":5776
 *                 '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":5778
 *         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":5779
 * 
 *         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 = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_317), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __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 = 5779; __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_33_get_nominal_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_32_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_33_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_32_get_nominal_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5788
 *     """)
 * 
 *     def _get_nominal_continuous_states(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the nominal values of the continuous states.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_32_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":5796
 *         """
 *         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_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 = 5796; __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 = 5796; __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 = 5796; __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 = 5796; __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 = 5796; __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 = 5796; __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 = 5796; __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 = 5796; __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 = 5796; __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 = 5796; __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 = 5796; __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":5799
 * 
 *         status = FMIL.fmi2_import_get_nominal_continuous_states(
 *                 self._fmu, <FMIL.fmi2_real_t*> ndx.data, self._nContinuousStates)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_get_nominal_continuous_states(__pyx_v_self->__pyx_base._fmu, ((fmi2_real_t *)__pyx_v_ndx->data), __pyx_v_self->__pyx_base._nContinuousStates);

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

  /* "pyfmi\fmi.pyx":5804
 *             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":5812
 *     """)
 * 
 *     cpdef get_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the derivative of the continuous states.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_35get_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 overriden 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 = 5812; __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_35get_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 = 5812; __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":5828
 *         """
 *         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 = 5828; __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 = 5828; __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 = 5828; __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 = 5828; __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 = 5828; __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 = 5828; __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 = 5828; __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 = 5828; __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 = 5828; __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 = 5828; __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 = 5828; __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":5830
 *         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":5832
 *         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.')
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":5833
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the derivative values.')             # <<<<<<<<<<<<<<
 * 
 *         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 = 5833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_319), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5833; __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 = 5833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5835
 *             raise FMUException('Failed to get the derivative values.')
 * 
 *         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_35get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_34get_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: fmiGetDerivatives\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_35get_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_34get_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5812
 *     """)
 * 
 *     cpdef get_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the derivative of the continuous states.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_34get_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 = 5812; __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_37simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_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: 0.0\n\n            final_time --\n                Final time for the simulation.\n                Default: 1.0\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. 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 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_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;
  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 *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 0);
  {
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = __pyx_k_320;
    values[1] = __pyx_k_321;

    /* "pyfmi\fmi.pyx":5841
 *                  start_time=0.0,
 *                  final_time=1.0,
 *                  input=(),             # <<<<<<<<<<<<<<
 *                  algorithm='AssimuloFMIAlg',
 *                  options={}):
 */
    values[2] = ((PyObject *)__pyx_empty_tuple);
    values[3] = ((PyObject *)__pyx_n_s__AssimuloFMIAlg);
    values[4] = __pyx_k_322;
    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 = 5838; __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 = 5838; __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_36simulate(((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":5838
 * 
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time=0.0,
 *                  final_time=1.0,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_36simulate(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;
  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", 0);

  /* "pyfmi\fmi.pyx":5903
 *             Result object, subclass of common.algorithm_drivers.ResultBase.
 *         """
 *         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_111); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyfmi\fmi.pyx":5908
 *                                              'pyfmi.fmi_algorithm_drivers',
 *                                              algorithm,
 *                                              options)             # <<<<<<<<<<<<<<
 * 
 *     def simulate_options(self, algorithm='AssimuloFMIAlg'):
 */
  __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5903; __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_kp_s_112));
  PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_kp_s_112));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_112));
  __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 = 5903; __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", __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_39simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_38simulate_options[] = "\n        Get an instance of the simulate options class, prefilled 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_39simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__algorithm,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 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 = 5910; __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 = 5910; __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_38simulate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_algorithm);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5910
 *                                              options)
 * 
 *     def simulate_options(self, algorithm='AssimuloFMIAlg'):             # <<<<<<<<<<<<<<
 *         """
 *         Get an instance of the simulate options class, prefilled with default
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_38simulate_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":5927
 *             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 = 5927; __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 = 5927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_112));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_112));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_112));
  __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 = 5927; __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 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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,0};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_13);
    values[2] = __pyx_k_323;
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[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 = 5934; __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 = 5934; __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":5934
 * #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":5935
 * 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_324)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":5936
 *     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 = 5936; __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 = 5936; __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 = 5936; __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_1load_fmu_deprecated(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_load_fmu_deprecated[] = "\n    Helper function for loading FMUs of different kinds.\n    ";
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_1load_fmu_deprecated = {__Pyx_NAMESTR("load_fmu_deprecated"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_1load_fmu_deprecated, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_load_fmu_deprecated)};
static PyObject *__pyx_pw_5pyfmi_3fmi_1load_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;
  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 *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_fmu_deprecated (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_13);
    values[2] = __pyx_k_325;
    values[3] = ((PyObject *)__pyx_kp_s_6);
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[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 = 5938; __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 = 5938; __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_load_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":5938
 *         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_load_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":5954
 * 
 *     #Used for deallocation
 *     allocated_context = False             # <<<<<<<<<<<<<<
 *     allocated_xml = False
 *     fmu_temp_dir = None
 */
  __pyx_v_allocated_context = 0;

  /* "pyfmi\fmi.pyx":5955
 *     #Used for deallocation
 *     allocated_context = False
 *     allocated_xml = False             # <<<<<<<<<<<<<<
 *     fmu_temp_dir = None
 * 
 */
  __pyx_v_allocated_xml = 0;

  /* "pyfmi\fmi.pyx":5956
 *     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":5958
 *     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 = 5958; __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 = 5958; __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 = 5958; __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 = 5958; __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 = 5958; __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 = 5958; __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 = 5958; __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 = 5958; __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 = 5958; __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 = 5958; __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":5959
 * 
 *     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 = 5959; __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 = 5959; __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":5962
 * 
 *     # 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 = 5962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_326), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5962; __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 = 5962; __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":5963
 *     # 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 = 5963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_327), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5963; __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 = 5963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5966
 * 
 *     #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":5967
 *     #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":5968
 *     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":5969
 *     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":5970
 *     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":5971
 *     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 = 5971; __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":5975
 * 
 *     #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":5976
 *     #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":5977
 *     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":5979
 *     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":5980
 * 
 *     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":5983
 * 
 *     #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 = 5983; __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 = 5983; __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 = 5983; __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":5985
 *     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 = 5985; __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); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __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 = 5985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":5986
 * 
 *     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":5989
 * 
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    if (__pyx_v_allocated_context) {

      /* "pyfmi\fmi.pyx":5990
 *         #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":5992
 *             FMIL.fmi_import_free_context(context)
 * 
 *         if enable_logging:             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU version could not be determined. "+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 = 5992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":5993
 * 
 *         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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_22), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = 5993; __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_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5993; __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_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 = 5993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":5995
 *             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:
 *         #Delete the context
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_328), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5995; __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 = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L6:;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5996
 *         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_3 = PyObject_RichCompare(__pyx_v_version, __pyx_int_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":5998
 *     if version != 1:
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    if (__pyx_v_allocated_context) {

      /* "pyfmi\fmi.pyx":5999
 *         #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":6001
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Parse the XML
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_330), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6001; __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 = 6001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":6004
 * 
 *     #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 = 6004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__fmu = fmi1_import_parse_xml(__pyx_v_context, __pyx_t_9);

  /* "pyfmi\fmi.pyx":6005
 *     #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":6006
 *     _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. "+last_error)
 */
    __pyx_v_last_error = jm_get_last_error((&__pyx_v_callbacks));

    /* "pyfmi\fmi.pyx":6007
 *     if _fmu == NULL:
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 *         if enable_logging:             # <<<<<<<<<<<<<<
 *             raise FMUException("The XML file could not be parsed. "+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 = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6008
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 *         if enable_logging:
 *             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 = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_27), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__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 = 6008; __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 = 6008; __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 = 6008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L10;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6010
 *             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.")             # <<<<<<<<<<<<<<
 *     allocated_xml = True
 * 
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_331), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6010; __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 = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L10:;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":6011
 *         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":6014
 * 
 *     #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_3 = PyInt_FromLong(fmi1_import_get_fmu_kind(__pyx_v__fmu)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_fmu_kind = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":6015
 *     #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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_ME); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_fmu_kind, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __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 = 6015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6016
 *     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_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_fmu);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fmu);
    __Pyx_GIVEREF(__pyx_v_fmu);
    __Pyx_INCREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    __Pyx_INCREF(__pyx_v_enable_logging);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_enable_logging);
    __Pyx_GIVEREF(__pyx_v_enable_logging);
    __Pyx_INCREF(__pyx_v_log_file_name);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_log_file_name);
    __Pyx_GIVEREF(__pyx_v_log_file_name);
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME1)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_v_model = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L11;
  }

  /* "pyfmi\fmi.pyx":6017
 *     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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_CS_STANDALONE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_fmu_kind, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __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 = 6017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6018
 *         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_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_fmu);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fmu);
    __Pyx_GIVEREF(__pyx_v_fmu);
    __Pyx_INCREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    __Pyx_INCREF(__pyx_v_enable_logging);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_enable_logging);
    __Pyx_GIVEREF(__pyx_v_enable_logging);
    __Pyx_INCREF(__pyx_v_log_file_name);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_log_file_name);
    __Pyx_GIVEREF(__pyx_v_log_file_name);
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_v_model = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6021
 *     else:
 *         #Delete the XML
 *         if allocated_xml:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free(_fmu)
 * 
 */
    if (__pyx_v_allocated_xml) {

      /* "pyfmi\fmi.pyx":6022
 *         #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":6025
 * 
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    if (__pyx_v_allocated_context) {

      /* "pyfmi\fmi.pyx":6026
 *         #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":6028
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Delete the XML
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_332), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6028; __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 = 6028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L11:;

  /* "pyfmi\fmi.pyx":6031
 * 
 *     #Delete the XML
 *     if allocated_xml:             # <<<<<<<<<<<<<<
 *         FMIL.fmi1_import_free(_fmu)
 * 
 */
  if (__pyx_v_allocated_xml) {

    /* "pyfmi\fmi.pyx":6032
 *     #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":6035
 * 
 *     #Delete the context
 *     if allocated_context:             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_free_context(context)
 * 
 */
  if (__pyx_v_allocated_context) {

    /* "pyfmi\fmi.pyx":6036
 *     #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":6039
 * 
 *     #Delete the created directory
 *     delete_temp_dir(fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *     return model
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__delete_temp_dir); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6039; __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 = 6039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_fmu_temp_dir);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fmu_temp_dir);
  __Pyx_GIVEREF(__pyx_v_fmu_temp_dir);
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6039; __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_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6041
 *     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_3_handle_load_fmu_exception(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_3_handle_load_fmu_exception = {__Pyx_NAMESTR("_handle_load_fmu_exception"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_3_handle_load_fmu_exception, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5pyfmi_3fmi_3_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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__log_file,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_handle_load_fmu_exception (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_file);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_handle_load_fmu_exception", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6043; __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 = 6043; __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 = 6043; __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_2_handle_load_fmu_exception(__pyx_self, __pyx_v_fmu, __pyx_v_log_file);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6043
 *     return model
 * 
 * def _handle_load_fmu_exception(fmu, log_file):             # <<<<<<<<<<<<<<
 *     log = []
 *     with open(log_file,'r') as file:
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_2_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":6044
 * 
 * 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 = 6044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_log = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6045
 * 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 = 6045; __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 = 6045; __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 = 6045; __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 = 6045; __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 = 6045; __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":6046
 *     log = []
 *     with open(log_file,'r') as file:
 *         while True:             # <<<<<<<<<<<<<<
 *             line = file.readline()
 *             if line == "":
 */
          while (1) {
            if (!1) break;

            /* "pyfmi\fmi.pyx":6047
 *     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 = 6047; __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 = 6047; __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":6048
 *         while True:
 *             line = file.readline()
 *             if line == "":             # <<<<<<<<<<<<<<
 *                 break
 *             log.append(line.strip("\n"))
 */
            __pyx_t_8 = __Pyx_PyString_Equals(__pyx_v_line, ((PyObject *)__pyx_kp_s_6), Py_EQ); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6048; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            if (__pyx_t_8) {

              /* "pyfmi\fmi.pyx":6049
 *             line = file.readline()
 *             if line == "":
 *                 break             # <<<<<<<<<<<<<<
 *             log.append(line.strip("\n"))
 * 
 */
              goto __pyx_L17_break;
              goto __pyx_L18;
            }
            __pyx_L18:;

            /* "pyfmi\fmi.pyx":6050
 *             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 = 6050; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_333), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6050; __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 = 6050; __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":6045
 * 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 = 6045; __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 = 6045; __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 = 6045; __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 = 6045; __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 = 6045; __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_334, NULL);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6045; __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 = 6045; __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":6052
 *             log.append(line.strip("\n"))
 * 
 *     for i in range(len(log)):             # <<<<<<<<<<<<<<
 *         print log[i]
 * 
 */
  __pyx_t_13 = PyList_GET_SIZE(((PyObject *)__pyx_v_log)); 
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6052; __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 = 6052; __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 = 6052; __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 = 6052; __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;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++;
    } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++;
    } 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 = 6052; __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":6053
 * 
 *     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 = 6053; __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 = 6053; __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_5load_fmu(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_4load_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 availible)\n\n    Returns::\n\n        A model instance corresponding to the loaded FMU.\n    ";
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_5load_fmu = {__Pyx_NAMESTR("load_fmu"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_5load_fmu, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_4load_fmu)};
static PyObject *__pyx_pw_5pyfmi_3fmi_5load_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;
  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 *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_fmu (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_13);

    /* "pyfmi\fmi.pyx":6055
 *         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_6);
    values[4] = ((PyObject *)__pyx_n_s__auto);
    values[5] = __pyx_k_335;
    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:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[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 = 6055; __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 = 6055; __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_4load_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_4load_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;
  char *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  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":6109
 * 
 *     #Variables for deallocation
 *     fmu_temp_dir = None             # <<<<<<<<<<<<<<
 *     model        = None
 *     log_file     = create_temp_file()
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_fmu_temp_dir = Py_None;

  /* "pyfmi\fmi.pyx":6110
 *     #Variables for deallocation
 *     fmu_temp_dir = None
 *     model        = None             # <<<<<<<<<<<<<<
 *     log_file     = 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":6111
 *     fmu_temp_dir = None
 *     model        = None
 *     log_file     = 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__create_temp_file); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6111; __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 = 6111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_log_file = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":6112
 *     model        = None
 *     log_file     = 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_3 = PyBytes_AsString(__pyx_v_log_file); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_log_file_c = ((char *)malloc(((strlen(__pyx_t_3) + 1) * (sizeof(char)))));

  /* "pyfmi\fmi.pyx":6113
 *     log_file     = 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_3 = PyBytes_AsString(__pyx_v_log_file); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_log_file_c, __pyx_t_3);

  /* "pyfmi\fmi.pyx":6116
 * 
 *     # 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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6116; __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 = 6116; __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__abspath); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6116; __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_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_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 = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __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 = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6116; __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 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6116; __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_v_fmu_full_path = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":6117
 *     # 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 = 6117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_336), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = (!__pyx_t_6);
  if (__pyx_t_7) {

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

  /* "pyfmi\fmi.pyx":6121
 * 
 *     #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 = 6121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__isfile); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__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 = 6121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_fmu_full_path);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fmu_full_path);
  __Pyx_GIVEREF(__pyx_v_fmu_full_path);
  __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6121; __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_4)); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (!__pyx_t_7);
  if (__pyx_t_6) {

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

  /* "pyfmi\fmi.pyx":6125
 * 
 *     #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_4 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6125; __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 = 6125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyString_Equals(__pyx_t_2, ((PyObject *)__pyx_n_s__auto), Py_EQ); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = (!__pyx_t_6);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":6126
 *     #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_2 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6126; __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 = 6126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyString_Equals(__pyx_t_4, ((PyObject *)__pyx_n_s__ME), Py_NE); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_7) {
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6126; __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 = 6126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyString_Equals(__pyx_t_2, ((PyObject *)__pyx_n_s__CS), Py_NE); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __pyx_t_6;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":6127
 *     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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_339), __pyx_v_kind); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6127; __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 = 6127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":6131
 * 
 *     #Specify FMI related callbacks
 *     callbacks.malloc    = FMIL.malloc             # <<<<<<<<<<<<<<
 *     callbacks.calloc    = FMIL.calloc
 *     callbacks.realloc   = FMIL.realloc
 */
  __pyx_v_callbacks.malloc = malloc;

  /* "pyfmi\fmi.pyx":6132
 *     #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":6133
 *     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":6134
 *     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":6135
 *     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":6136
 *     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":6138
 *     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":6140
 *     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_4 = PyObject_RichCompare(__pyx_v_enable_logging, Py_None, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":6141
 * 
 *     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_4 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_4, Py_GE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6141; __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 = 6141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_5, Py_LE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __pyx_t_7;
    } else {
      __pyx_t_6 = __pyx_t_8;
    }
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6142
 *     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_4 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {

        /* "pyfmi\fmi.pyx":6143
 *         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 = 6143; __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":6145
 *                 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 = 6145; __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":6146
 *             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 = 6146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_callbacks.log_level = __pyx_t_9;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6148
 *             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 = 6148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyInt_FromLong(jm_log_level_all); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6148; __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 = 6148; __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);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_4 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_15), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __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 = 6148; __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_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6148; __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 = 6148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L8:;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6150
 *             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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_340), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":6151
 *     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 = 6151; __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":6160
 * 
 *     #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":6161
 *     #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":6162
 *     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":6165
 * 
 *     #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":6166
 *     #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":6167
 *     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":6171
 * 
 *     # 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":6174
 * 
 *     #Get the FMI version of the provided model
 *     fmu_temp_dir = create_temp_dir()             # <<<<<<<<<<<<<<
 *     version = FMIL.fmi_import_get_fmi_version(context, fmu_full_path, fmu_temp_dir)
 * 
 */
  __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 = 6174; __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 = 6174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_fmu_temp_dir);
  __pyx_v_fmu_temp_dir = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6175
 *     #Get the FMI version of the provided model
 *     fmu_temp_dir = create_temp_dir()
 *     version = FMIL.fmi_import_get_fmi_version(context, fmu_full_path, fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_fmu_full_path); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6175; __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 = 6175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_version = fmi_import_get_fmi_version(__pyx_v_context, __pyx_t_3, __pyx_t_10);

  /* "pyfmi\fmi.pyx":6179
 * 
 *     #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":6181
 *     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":6182
 *         #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":6183
 *         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 = 6183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

    /* "pyfmi\fmi.pyx":6184
 *         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. "+last_error)
 */
    __pyx_t_6 = (__pyx_v_callbacks.log_level >= jm_log_level_error);
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6185
 *         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. "+last_error)
 *         else:
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_341); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6185; __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 = 6185; __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 = 6185; __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":6186
 *         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. "+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 = 6186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_22), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6186; __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 = PyTuple_New(1); 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);
      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_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6186; __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 = 6186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6188
 *             raise FMUException("The FMU version could not be determined. "+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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_341); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6188; __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 = 6188; __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 = 6188; __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":6189
 *         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 = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_342), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L11:;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "pyfmi\fmi.pyx":6191
 *             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":6193
 *     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":6194
 *         #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":6195
 *         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 = 6195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

    /* "pyfmi\fmi.pyx":6196
 *         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. "+last_error)
 */
    __pyx_t_6 = (__pyx_v_callbacks.log_level >= jm_log_level_error);
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6197
 *         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. "+last_error)
 *         else:
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_341); 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_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6197; __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_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6197; __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_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":6198
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is unsupported. "+last_error)             # <<<<<<<<<<<<<<
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_343), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_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 = 6198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __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 = 6198; __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_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L13;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6200
 *             raise FMUException("The FMU version is unsupported. "+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_341); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6200; __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_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6200; __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_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":6201
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is unsupported. 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 = 6201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_345), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6201; __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 = 6201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L13:;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pyfmi\fmi.pyx":6205
 * 
 *     #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":6207
 *     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 = 6207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmu_1 = fmi1_import_parse_xml(__pyx_v_context, __pyx_t_10);

    /* "pyfmi\fmi.pyx":6209
 *         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":6211
 *         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":6212
 *             #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":6213
 *             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 = 6213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":6214
 *             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. "+last_error)
 */
      __pyx_t_6 = (__pyx_v_callbacks.log_level >= jm_log_level_error);
      if (__pyx_t_6) {

        /* "pyfmi\fmi.pyx":6215
 *             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. "+last_error)
 *             else:
 */
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s_341); 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_t_1 = PyTuple_New(2); 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_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 = 6215; __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":6216
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException("The XML-could not be read. "+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 = 6216; __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 = 6216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_s_184), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __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 = 6216; __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 = 6216; __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 = 6216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L16;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":6218
 *                 raise FMUException("The XML-could not be read. "+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_341); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6218; __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 = 6218; __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 = 6218; __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":6219
 *             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 = 6219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_346), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6219; __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 = 6219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L16:;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "pyfmi\fmi.pyx":6221
 *                 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":6224
 * 
 *         #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 = 6224; __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 = 6224; __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); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __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 = 6224; __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 = 6224; __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 = 6224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyString_Equals(__pyx_t_2, ((PyObject *)__pyx_n_s__CS), Py_NE); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __pyx_t_8;
    } else {
      __pyx_t_7 = __pyx_t_6;
    }
    if (__pyx_t_7) {

      /* "pyfmi\fmi.pyx":6225
 *         #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_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6225; __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_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME1)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_v_model);
      __pyx_v_model = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L17;
    }

    /* "pyfmi\fmi.pyx":6226
 *         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_5 = PyInt_FromLong(__pyx_v_fmu_1_kind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __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 = 6226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6226; __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 = 6226; __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 = 6226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyString_Equals(__pyx_t_2, ((PyObject *)__pyx_n_s__ME), Py_NE); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __pyx_t_6;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":6227
 *             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_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6227; __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_FMUModelCS1)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6227; __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_L17;
    }

    /* "pyfmi\fmi.pyx":6228
 *         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":6229
 *             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":6230
 *         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":6231
 *             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 = 6231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":6232
 *             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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_341); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6232; __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 = 6232; __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 = 6232; __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":6233
 *             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_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_348), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 6233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L17;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6235
 *             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":6236
 *         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":6237
 *             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 = 6237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":6238
 *             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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_341); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6238; __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_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6238; __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_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":6239
 *             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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyBytes_FromString(fmi1_fmu_kind_to_string(__pyx_v_fmu_1_kind)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_349), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Add(__pyx_t_2, ((PyObject *)__pyx_kp_s_350)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6239; __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 = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6239; __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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6239; __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_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 = 6239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L17:;
    goto __pyx_L14;
  }

  /* "pyfmi\fmi.pyx":6241
 *             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":6243
 *     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 = 6243; __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":6245
 *         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":6247
 *         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":6248
 *             #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":6249
 *             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 = 6249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":6250
 *             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. "+last_error)
 */
      __pyx_t_8 = (__pyx_v_callbacks.log_level >= jm_log_level_error);
      if (__pyx_t_8) {

        /* "pyfmi\fmi.pyx":6251
 *             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. "+last_error)
 *             else:
 */
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_341); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6251; __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_4)); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pyfmi\fmi.pyx":6252
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException("The XML-could not be read. "+last_error)             # <<<<<<<<<<<<<<
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)
 */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6252; __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 = 6252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_4));
        __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_184), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(((PyObject *)__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 = 6252; __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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6252; __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_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 = 6252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L19;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":6254
 *                 raise FMUException("The XML-could not be read. "+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_341); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = PyTuple_New(2); 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_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6254; __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_4)); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pyfmi\fmi.pyx":6255
 *             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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_351), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6255; __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 = 6255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L19:;
      goto __pyx_L18;
    }
    __pyx_L18:;

    /* "pyfmi\fmi.pyx":6257
 *                 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":6260
 * 
 *         #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":6261
 *         #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":6262
 *         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":6263
 *             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":6264
 *             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 = 6264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":6265
 *             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. "+last_error)
 */
      __pyx_t_8 = (__pyx_v_callbacks.log_level >= jm_log_level_error);
      if (__pyx_t_8) {

        /* "pyfmi\fmi.pyx":6266
 *             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. "+last_error)
 *             else:
 */
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s_341); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6266; __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 = 6266; __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_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6266; __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":6267
 *             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. "+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 = 6267; __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 = 6267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_187), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __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 = 6267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6267; __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_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 = 6267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L21;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":6269
 *                 raise FMUException("The FMU kind could not be determined. "+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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s_341); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6269; __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 = 6269; __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_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6269; __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;

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

    /* "pyfmi\fmi.pyx":6273
 * 
 *         #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)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__lower); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6273; __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 = 6273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyString_Equals(__pyx_t_2, ((PyObject *)__pyx_n_s__auto), Py_EQ); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":6274
 *         #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)
 *             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":6275
 *         if kind.lower() == 'auto':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name)             # <<<<<<<<<<<<<<
 *             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)
 */
        __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6275; __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_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6275; __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;
      }

      /* "pyfmi\fmi.pyx":6276
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name)
 *             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)
 *         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":6277
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name)
 *             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)             # <<<<<<<<<<<<<<
 *         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_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6277; __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_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME2)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6277; __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;
      }
      __pyx_L23:;
      goto __pyx_L22;
    }

    /* "pyfmi\fmi.pyx":6278
 *             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)
 *         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)
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_n_s__CS), Py_EQ); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6279
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name)
 *         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)
 *         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":6280
 *         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)             # <<<<<<<<<<<<<<
 *         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(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6280; __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_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 = 6280; __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":6281
 *             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)
 *         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)
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6281; __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 = 6281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_n_s__ME), Py_EQ); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_7) {

      /* "pyfmi\fmi.pyx":6282
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name)
 *         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)
 * 
 */
      __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":6283
 *         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)             # <<<<<<<<<<<<<<
 * 
 *         #Could not match FMU kind with input-specified kind
 */
        __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6283; __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_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME2)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6283; __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_L25;
      }
      __pyx_L25:;
      goto __pyx_L22;
    }
    __pyx_L22:;

    /* "pyfmi\fmi.pyx":6286
 * 
 *         #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":6287
 *         #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":6288
 *         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":6289
 *             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 = 6289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":6290
 *             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_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_341); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6290; __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 = 6290; __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_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6290; __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_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyfmi\fmi.pyx":6291
 *             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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyBytes_FromString(fmi2_fmu_kind_to_string(__pyx_v_fmu_2_kind)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_349), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6291; __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 = PyNumber_Add(__pyx_t_2, ((PyObject *)__pyx_kp_s_350)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6291; __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_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6291; __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 = 6291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6291; __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_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6291; __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_5)); __pyx_t_5 = 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 = 6291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L26;
    }
    __pyx_L26:;
    goto __pyx_L14;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6297
 * 
 *         #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":6298
 *         #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":6299
 *         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 = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

    /* "pyfmi\fmi.pyx":6300
 *         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. "+last_error)
 */
    __pyx_t_8 = (__pyx_v_callbacks.log_level >= jm_log_level_error);
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":6301
 *         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. "+last_error)
 *         else:
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_341); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6301; __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_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyfmi\fmi.pyx":6302
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is not found. "+last_error)             # <<<<<<<<<<<<<<
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_353), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __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 = 6302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6302; __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_5)); __pyx_t_5 = 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 = 6302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L27;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6304
 *             raise FMUException("The FMU version is not found. "+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_341); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6304; __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_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

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

  /* "pyfmi\fmi.pyx":6308
 * 
 *     #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":6309
 *     #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":6310
 *     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":6311
 *         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 = 6311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);
    goto __pyx_L28;
  }
  __pyx_L28:;

  /* "pyfmi\fmi.pyx":6313
 *         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":6314
 * 
 *     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":6315
 *     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":6316
 *         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 = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);
    goto __pyx_L29;
  }
  __pyx_L29:;

  /* "pyfmi\fmi.pyx":6319
 * 
 *     #Delete log file
 *     delete_temp_file(log_file)             # <<<<<<<<<<<<<<
 *     FMIL.free(log_file_c)
 * 
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__delete_temp_file); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6319; __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 = 6319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_log_file);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_log_file);
  __Pyx_GIVEREF(__pyx_v_log_file);
  __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6319; __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_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":6320
 *     #Delete log file
 *     delete_temp_file(log_file)
 *     FMIL.free(log_file_c)             # <<<<<<<<<<<<<<
 * 
 *     return model
 */
  free(__pyx_v_log_file_c);

  /* "pyfmi\fmi.pyx":6322
 *     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_4);
  __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 int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static 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":193
 *         # 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":199
 *             # 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":202
 * 
 *             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":203
 *             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":205
 *             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":207
 *             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":208
 * 
 *             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":210
 *                 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":212
 *                 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":213
 * 
 *             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":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")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_357), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __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 = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "numpy.pxd":216
 *                 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":217
 * 
 *             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":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")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_359), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __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 = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "numpy.pxd":220
 *                 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":221
 * 
 *             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":222
 *             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":225
 *                 # 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":226
 *                 # 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":227
 *                 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":228
 *                 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":229
 *                 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":231
 *                     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":232
 *             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":233
 *                 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":234
 *                 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":235
 *             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":238
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "numpy.pxd":239
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 *             cdef int offset
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self->descr));
  __pyx_v_descr = __pyx_v_self->descr;

  /* "numpy.pxd":243
 *             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":245
 *             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":247
 *             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":250
 *             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":252
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 */
  __pyx_t_1 = (!__pyx_v_hasfields);
  if (__pyx_t_1) {

    /* "numpy.pxd":253
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 */
    __pyx_v_t = __pyx_v_descr->type_num;

    /* "numpy.pxd":254
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == '<' 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":255
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' 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":256
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' 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_361), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 256; __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 = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "numpy.pxd":257
 *                     (descr.byteorder == '<' 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":258
 *                     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":259
 *                 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":260
 *                 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":261
 *                 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":262
 *                 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":263
 *                 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":264
 *                 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":265
 *                 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":266
 *                 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":267
 *                 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":268
 *                 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":269
 *                 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":270
 *                 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":271
 *                 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":272
 *                 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":273
 *                 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":275
 *                 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 = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_362), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __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 = 275; __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 = 275; __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 = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L13:;

    /* "numpy.pxd":276
 *                 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":277
 *                     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":279
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0
 */
    __pyx_v_info->format = ((char *)malloc(255));

    /* "numpy.pxd":280
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = '^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "numpy.pxd":281
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = '^' # 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":284
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)             # <<<<<<<<<<<<<<
 *                 f[0] = 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 = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_9;

    /* "numpy.pxd":285
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = 0 # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = 0;
  }
  __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 void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static 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":287
 *                 f[0] = 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":288
 * 
 *         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":289
 *         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":290
 *             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":291
 *                 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":767
 * 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":768
 * 
 * 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 = 768; __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":770
 *     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":771
 * 
 * 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 = 771; __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":773
 *     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":774
 * 
 * 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 = 774; __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":776
 *     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":777
 * 
 * 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 = 777; __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":779
 *     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":780
 * 
 * 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 = 780; __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":782
 *     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;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  long __pyx_t_10;
  char *__pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "numpy.pxd":789
 *     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":790
 *     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":793
 *     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 = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
    __Pyx_XDECREF(__pyx_v_childname);
    __pyx_v_childname = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "numpy.pxd":794
 * 
 *     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 = 794; __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 = 794; __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":795
 *     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 (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __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":797
 *         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 = 797; __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 = 797; __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 = 797; __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 = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __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[2]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {

      /* "numpy.pxd":798
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 */
      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_364), NULL); 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_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "numpy.pxd":800
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_6 = (__pyx_v_child->byteorder == '>');
    if (__pyx_t_6) {
      __pyx_t_7 = __pyx_v_little_endian;
    } else {
      __pyx_t_7 = __pyx_t_6;
    }
    if (!__pyx_t_7) {

      /* "numpy.pxd":801
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
      __pyx_t_6 = (__pyx_v_child->byteorder == '<');
      if (__pyx_t_6) {
        __pyx_t_8 = (!__pyx_v_little_endian);
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_6;
      }
      __pyx_t_6 = __pyx_t_9;
    } else {
      __pyx_t_6 = __pyx_t_7;
    }
    if (__pyx_t_6) {

      /* "numpy.pxd":802
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' 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_365), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __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 = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "numpy.pxd":812
 * 
 *         # 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 = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_6) break;

      /* "numpy.pxd":813
 *         # 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":814
 *         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":815
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_10 = 0;
      (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1);
    }

    /* "numpy.pxd":817
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_10 = 0;
    (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize);

    /* "numpy.pxd":819
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child));
    if (__pyx_t_6) {

      /* "numpy.pxd":820
 * 
 *         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 = 820; __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":821
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5);
      if (__pyx_t_6) {

        /* "numpy.pxd":822
 *             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_367), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __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 = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "numpy.pxd":825
 * 
 *             # 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 = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __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[2]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L11;
      }

      /* "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"
 *             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 = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L11;
      }

      /* "numpy.pxd":827
 *             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 = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __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[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 104;
        goto __pyx_L11;
      }

      /* "numpy.pxd":828
 *             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 = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L11;
      }

      /* "numpy.pxd":829
 *             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 = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __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[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 105;
        goto __pyx_L11;
      }

      /* "numpy.pxd":830
 *             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 = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L11;
      }

      /* "numpy.pxd":831
 *             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 = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __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[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 108;
        goto __pyx_L11;
      }

      /* "numpy.pxd":832
 *             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 = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L11;
      }

      /* "numpy.pxd":833
 *             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 = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __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[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 113;
        goto __pyx_L11;
      }

      /* "numpy.pxd":834
 *             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 = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L11;
      }

      /* "numpy.pxd":835
 *             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 = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __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[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 102;
        goto __pyx_L11;
      }

      /* "numpy.pxd":836
 *             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 = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 100;
        goto __pyx_L11;
      }

      /* "numpy.pxd":837
 *             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 = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __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[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 103;
        goto __pyx_L11;
      }

      /* "numpy.pxd":838
 *             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 = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __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_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 102;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L11;
      }

      /* "numpy.pxd":839
 *             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 = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __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[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 100;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L11;
      }

      /* "numpy.pxd":840
 *             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 = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 103;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L11;
      }

      /* "numpy.pxd":841
 *             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 = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __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[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "numpy.pxd":843
 *             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_362), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; __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 = 843; __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 = 843; __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 = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L11:;

      /* "numpy.pxd":844
 *             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_L9;
    }
    /*else*/ {

      /* "numpy.pxd":848
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
      __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_11;
    }
    __pyx_L9:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "numpy.pxd":849
 *             # 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":964
 * 
 * 
 * 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":966
 * 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":967
 *      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":969
 *          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":970
 *      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":971
 *          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":972
 *          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":974
 *      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":975
 * 
 * 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":976
 * 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":978
 *         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, PyObject *a, 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("_default_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_9_default_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_8_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, PyObject *a, 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;
  Py_XDECREF(p->_name);
  Py_XDECREF(p->_description);
  (*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, PyObject *a, 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;
  Py_XDECREF(p->_name);
  Py_XDECREF(p->_description);
  (*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)},
  {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, PyObject *a, 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;
  Py_XDECREF(p->__t);
  Py_XDECREF(p->_file_open);
  Py_XDECREF(p->_npoints);
  Py_XDECREF(p->_enable_logging);
  Py_XDECREF(p->_pyEventInfo);
  Py_XDECREF(((PyObject *)p->_log));
  Py_XDECREF(p->_allocated_list);
  Py_XDECREF(p->_modelid);
  Py_XDECREF(p->_modelname);
  Py_XDECREF(((PyObject *)p->_save_real_variables_val));
  Py_XDECREF(((PyObject *)p->_save_int_variables_val));
  Py_XDECREF(((PyObject *)p->_save_bool_variables_val));
  __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;
  if (__pyx_ptype_5pyfmi_3fmi_ModelBase->tp_traverse) {
    e = __pyx_ptype_5pyfmi_3fmi_ModelBase->tp_traverse(o, v, a); if (e) return e;
  }
  if (p->__t) {
    e = (*v)(p->__t, a); if (e) return e;
  }
  if (p->_file_open) {
    e = (*v)(p->_file_open, a); if (e) return e;
  }
  if (p->_npoints) {
    e = (*v)(p->_npoints, a); if (e) return e;
  }
  if (p->_enable_logging) {
    e = (*v)(p->_enable_logging, a); if (e) return e;
  }
  if (p->_pyEventInfo) {
    e = (*v)(p->_pyEventInfo, a); if (e) return e;
  }
  if (p->_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 (__pyx_ptype_5pyfmi_3fmi_ModelBase->tp_clear) {
    __pyx_ptype_5pyfmi_3fmi_ModelBase->tp_clear(o);
  }
  tmp = ((PyObject*)p->__t);
  p->__t = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_file_open);
  p->_file_open = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_npoints);
  p->_npoints = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_enable_logging);
  p->_enable_logging = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_pyEventInfo);
  p->_pyEventInfo = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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("get_log"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3get_log, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_2get_log)},
  {__Pyx_NAMESTR("_internal_set_fmu_null"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_5_internal_set_fmu_null, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_4_internal_set_fmu_null)},
  {__Pyx_NAMESTR("print_log"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_7print_log, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_6print_log)},
  {__Pyx_NAMESTR("_convert_filter"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_9_convert_filter, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_8_convert_filter)},
  {__Pyx_NAMESTR("_get_version"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_11_get_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_10_get_version)},
  {__Pyx_NAMESTR("get_ode_sizes"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_13get_ode_sizes, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_12get_ode_sizes)},
  {__Pyx_NAMESTR("get_real"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15get_real, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_14get_real)},
  {__Pyx_NAMESTR("set_real"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_17set_real, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_16set_real)},
  {__Pyx_NAMESTR("get_integer"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_19get_integer, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_18get_integer)},
  {__Pyx_NAMESTR("set_integer"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_21set_integer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_20set_integer)},
  {__Pyx_NAMESTR("get_boolean"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23get_boolean, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_22get_boolean)},
  {__Pyx_NAMESTR("set_boolean"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_25set_boolean, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_24set_boolean)},
  {__Pyx_NAMESTR("get_string"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_27get_string, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_26get_string)},
  {__Pyx_NAMESTR("set_string"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_29set_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_28set_string)},
  {__Pyx_NAMESTR("set_debug_logging"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_31set_debug_logging, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_30set_debug_logging)},
  {__Pyx_NAMESTR("set_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_33set_log_level, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_32set_log_level)},
  {__Pyx_NAMESTR("set_fmil_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35set_fmil_log_level, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_set"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_36_set)},
  {__Pyx_NAMESTR("_get"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39_get, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_38_get)},
  {__Pyx_NAMESTR("get_variable_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41get_variable_description, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_40get_variable_description)},
  {__Pyx_NAMESTR("get_variable_data_type"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_data_type, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_42get_variable_data_type)},
  {__Pyx_NAMESTR("get_variable_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_valueref, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_44get_variable_valueref)},
  {__Pyx_NAMESTR("get_variable_nominal"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_nominal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_46get_variable_nominal)},
  {__Pyx_NAMESTR("get_variable_fixed"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_variable_fixed, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_48get_variable_fixed)},
  {__Pyx_NAMESTR("get_variable_start"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51get_variable_start, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_50get_variable_start)},
  {__Pyx_NAMESTR("get_variable_max"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_variable_max, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_52get_variable_max)},
  {__Pyx_NAMESTR("get_variable_min"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_min, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_54get_variable_min)},
  {__Pyx_NAMESTR("get_model_variables"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_model_variables, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_56get_model_variables)},
  {__Pyx_NAMESTR("get_model_time_varying_value_references"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_59get_model_time_varying_value_references, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_58get_model_time_varying_value_references)},
  {__Pyx_NAMESTR("get_variable_alias_base"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_variable_alias_base, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_60get_variable_alias_base)},
  {__Pyx_NAMESTR("get_variable_alias"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_63get_variable_alias, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_62get_variable_alias)},
  {__Pyx_NAMESTR("get_variable_variability"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_variable_variability, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_64get_variable_variability)},
  {__Pyx_NAMESTR("get_variable_by_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_variable_by_valueref, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_66get_variable_by_valueref)},
  {__Pyx_NAMESTR("get_variable_causality"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_variable_causality, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_68get_variable_causality)},
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_70get_name)},
  {__Pyx_NAMESTR("get_identifier"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_73get_identifier, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_72get_identifier)},
  {__Pyx_NAMESTR("get_author"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_75get_author, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_74get_author)},
  {__Pyx_NAMESTR("get_default_experiment_start_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_77get_default_experiment_start_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_76get_default_experiment_start_time)},
  {__Pyx_NAMESTR("get_default_experiment_stop_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_79get_default_experiment_stop_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_78get_default_experiment_stop_time)},
  {__Pyx_NAMESTR("get_default_experiment_tolerance"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_81get_default_experiment_tolerance, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_80get_default_experiment_tolerance)},
  {__Pyx_NAMESTR("get_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_83get_description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_82get_description)},
  {__Pyx_NAMESTR("get_generation_tool"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_85get_generation_tool, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_84get_generation_tool)},
  {__Pyx_NAMESTR("get_guid"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_87get_guid, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_86get_guid)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5pyfmi_3fmi_FMUModelBase[] = {
  {(char *)"__t", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase___t, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase___t, 0, 0},
  {(char *)"_file_open", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__file_open, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__file_open, 0, 0},
  {(char *)"_npoints", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__npoints, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__npoints, 0, 0},
  {(char *)"_enable_logging", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__enable_logging, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__enable_logging, 0, 0},
  {(char *)"_pyEventInfo", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__pyEventInfo, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__pyEventInfo, 0, 0},
  {(char *)"_save_real_variables_val", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_real_variables_val, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_real_variables_val, 0, 0},
  {(char *)"_save_int_variables_val", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_int_variables_val, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_int_variables_val, 0, 0},
  {(char *)"_save_bool_variables_val", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_bool_variables_val, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_bool_variables_val, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUModelBase = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_FMUModelBase = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FMUModelBase = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUModelBase = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_FMUModelBase = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUModelBase"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_FMUModelBase, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUModelBase, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUModelBase, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUModelBase, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    An FMI Model loaded from a DLL.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUModelBase, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5pyfmi_3fmi_FMUModelBase, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5pyfmi_3fmi_12FMUModelBase_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUModelBase, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 __pyx_vtable_5pyfmi_3fmi_FMUModelCS1;

static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelCS1(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *p;
  PyObject *o = __pyx_tp_new_5pyfmi_3fmi_FMUModelBase(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)o);
  p->__pyx_base.__pyx_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 *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);
  }
  __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("set_input_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_17set_input_derivatives, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_16set_input_derivatives)},
  {__Pyx_NAMESTR("simulate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_19simulate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_18simulate)},
  {__Pyx_NAMESTR("simulate_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_21simulate_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_20simulate_options)},
  {__Pyx_NAMESTR("initialize"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_23initialize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_22initialize)},
  {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_25reset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_24reset)},
  {__Pyx_NAMESTR("instantiate_slave"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_27instantiate_slave, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_26instantiate_slave)},
  {__Pyx_NAMESTR("get_capability_flags"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_29get_capability_flags, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_28get_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 *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);
  }
  __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_temp_dir = 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->_allocated_context = Py_None; Py_INCREF(Py_None);
  p->_allocated_xml = Py_None; Py_INCREF(Py_None);
  p->_allocated_dll = Py_None; Py_INCREF(Py_None);
  p->_allocated_fmu = Py_None; Py_INCREF(Py_None);
  p->_modelName = Py_None; Py_INCREF(Py_None);
  p->_fmu_log_name = 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);
  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;
  Py_XDECREF(((PyObject *)p->_log));
  Py_XDECREF(p->_fmu_temp_dir);
  Py_XDECREF(p->_fmu_full_path);
  Py_XDECREF(p->_enable_logging);
  Py_XDECREF(p->_allocated_context);
  Py_XDECREF(p->_allocated_xml);
  Py_XDECREF(p->_allocated_dll);
  Py_XDECREF(p->_allocated_fmu);
  Py_XDECREF(p->_modelName);
  Py_XDECREF(p->_fmu_log_name);
  Py_XDECREF(((PyObject *)p->_categories));
  Py_XDECREF(((PyObject *)p->_save_real_variables_val));
  Py_XDECREF(((PyObject *)p->_save_int_variables_val));
  Py_XDECREF(((PyObject *)p->_save_bool_variables_val));
  Py_XDECREF(p->__pyx___t);
  Py_XDECREF(p->_pyEventInfo);
  __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;
  if (__pyx_ptype_5pyfmi_3fmi_ModelBase->tp_traverse) {
    e = __pyx_ptype_5pyfmi_3fmi_ModelBase->tp_traverse(o, v, a); if (e) return e;
  }
  if (p->_log) {
    e = (*v)(p->_log, a); if (e) return e;
  }
  if (p->_fmu_temp_dir) {
    e = (*v)(p->_fmu_temp_dir, 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->_allocated_context) {
    e = (*v)(p->_allocated_context, a); if (e) return e;
  }
  if (p->_allocated_xml) {
    e = (*v)(p->_allocated_xml, a); if (e) return e;
  }
  if (p->_allocated_dll) {
    e = (*v)(p->_allocated_dll, a); if (e) return e;
  }
  if (p->_allocated_fmu) {
    e = (*v)(p->_allocated_fmu, a); if (e) return e;
  }
  if (p->_modelName) {
    e = (*v)(p->_modelName, a); if (e) return e;
  }
  if (p->_fmu_log_name) {
    e = (*v)(p->_fmu_log_name, 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;
  }
  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 (__pyx_ptype_5pyfmi_3fmi_ModelBase->tp_clear) {
    __pyx_ptype_5pyfmi_3fmi_ModelBase->tp_clear(o);
  }
  tmp = ((PyObject*)p->_log);
  p->_log = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_fmu_temp_dir);
  p->_fmu_temp_dir = 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->_allocated_context);
  p->_allocated_context = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_allocated_xml);
  p->_allocated_xml = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_allocated_dll);
  p->_allocated_dll = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_allocated_fmu);
  p->_allocated_fmu = 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->_fmu_log_name);
  p->_fmu_log_name = 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);
  return 0;
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__enable_logging(PyObject *o, 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, 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__fmu_log_name(PyObject *o, void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__fmu_log_name(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13_fmu_log_name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_real_variables_val(PyObject *o, 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, 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, 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, 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, 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, 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, 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, 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 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("set_fmil_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_27set_fmil_log_level, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_26set_fmil_log_level)},
  {__Pyx_NAMESTR("get_fmil_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_29get_fmil_log_level, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_28get_fmil_log_level)},
  {__Pyx_NAMESTR("set_debug_logging"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_31set_debug_logging, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_30set_debug_logging)},
  {__Pyx_NAMESTR("get_categories"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_33get_categories, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_32get_categories)},
  {__Pyx_NAMESTR("get_variable_nominal"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_35get_variable_nominal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_34get_variable_nominal)},
  {__Pyx_NAMESTR("get_variable_by_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_37get_variable_by_valueref, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_36get_variable_by_valueref)},
  {__Pyx_NAMESTR("get_variable_alias_base"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_39get_variable_alias_base, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_38get_variable_alias_base)},
  {__Pyx_NAMESTR("get_variable_alias"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_41get_variable_alias, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_40get_variable_alias)},
  {__Pyx_NAMESTR("get_model_time_varying_value_references"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_43get_model_time_varying_value_references, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_42get_model_time_varying_value_references)},
  {__Pyx_NAMESTR("get_model_variables"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_45get_model_variables, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_44get_model_variables)},
  {__Pyx_NAMESTR("get_variable_references"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_47get_variable_references, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_46get_variable_references)},
  {__Pyx_NAMESTR("get_variable_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_49get_variable_valueref, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_48get_variable_valueref)},
  {__Pyx_NAMESTR("get_variable_data_type"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_51get_variable_data_type, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_50get_variable_data_type)},
  {__Pyx_NAMESTR("get_variable_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_53get_variable_description, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_52get_variable_description)},
  {__Pyx_NAMESTR("get_variable_variability"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_55get_variable_variability, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_54get_variable_variability)},
  {__Pyx_NAMESTR("get_variable_causality"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_57get_variable_causality, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_56get_variable_causality)},
  {__Pyx_NAMESTR("get_variable_start"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_59get_variable_start, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_58get_variable_start)},
  {__Pyx_NAMESTR("get_variable_max"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_max, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_60get_variable_max)},
  {__Pyx_NAMESTR("get_variable_min"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_min, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_62get_variable_min)},
  {__Pyx_NAMESTR("get_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_65get_fmu_state, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_64get_fmu_state)},
  {__Pyx_NAMESTR("set_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67set_fmu_state, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_66set_fmu_state)},
  {__Pyx_NAMESTR("free_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_69free_fmu_state, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_68free_fmu_state)},
  {__Pyx_NAMESTR("serialize_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71serialize_fmu_state, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_70serialize_fmu_state)},
  {__Pyx_NAMESTR("deserialize_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73deserialize_fmu_state, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_72deserialize_fmu_state)},
  {__Pyx_NAMESTR("serialized_fmu_state_size"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_75serialized_fmu_state_size, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_74serialized_fmu_state_size)},
  {__Pyx_NAMESTR("get_ode_sizes"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_77get_ode_sizes, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_76get_ode_sizes)},
  {__Pyx_NAMESTR("get_default_experiment_start_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_79get_default_experiment_start_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_78get_default_experiment_start_time)},
  {__Pyx_NAMESTR("get_default_experiment_stop_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_81get_default_experiment_stop_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_80get_default_experiment_stop_time)},
  {__Pyx_NAMESTR("get_default_experiment_tolerance"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_83get_default_experiment_tolerance, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_82get_default_experiment_tolerance)},
  {__Pyx_NAMESTR("_convert_filter"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_85_convert_filter, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_84_convert_filter)},
  {__Pyx_NAMESTR("get_derivatives_list"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_87get_derivatives_list, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_86get_derivatives_list)},
  {__Pyx_NAMESTR("get_states_list"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_89get_states_list, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_88get_states_list)},
  {__Pyx_NAMESTR("get_input_list"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_91get_input_list, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_90get_input_list)},
  {__Pyx_NAMESTR("get_output_list"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_93get_output_list, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_92get_output_list)},
  {__Pyx_NAMESTR("get_capability_flags"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_95get_capability_flags, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_94get_capability_flags)},
  {__Pyx_NAMESTR("get_directional_derivative"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_97get_directional_derivative, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_96get_directional_derivative)},
  {__Pyx_NAMESTR("get_version"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_99get_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_98get_version)},
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_101get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_100get_name)},
  {__Pyx_NAMESTR("get_author"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_103get_author, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_102get_author)},
  {__Pyx_NAMESTR("get_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_105get_description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_104get_description)},
  {__Pyx_NAMESTR("get_generation_tool"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_107get_generation_tool, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_106get_generation_tool)},
  {__Pyx_NAMESTR("get_guid"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_109get_guid, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_108get_guid)},
  {__Pyx_NAMESTR("get_identifier"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_111get_identifier, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_110get_identifier)},
  {__Pyx_NAMESTR("get_model_types_platform"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_113get_model_types_platform, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_112get_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 *)"_fmu_log_name", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__fmu_log_name, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__fmu_log_name, 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},
  {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 *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);
  }
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase2(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelCS2[] = {
  {__Pyx_NAMESTR("instantiate_slave"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5instantiate_slave, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_4instantiate_slave)},
  {__Pyx_NAMESTR("initialize"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_7initialize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_6initialize)},
  {__Pyx_NAMESTR("reset_slave"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_9reset_slave, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_8reset_slave)},
  {__Pyx_NAMESTR("_get_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_11_get_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_10_get_time)},
  {__Pyx_NAMESTR("_set_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_13_set_time, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_12_set_time)},
  {__Pyx_NAMESTR("do_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_15do_step, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_14do_step)},
  {__Pyx_NAMESTR("cancel_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_17cancel_step, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_16cancel_step)},
  {__Pyx_NAMESTR("set_input_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_19set_input_derivatives, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_18set_input_derivatives)},
  {__Pyx_NAMESTR("get_output_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_21get_output_derivatives, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_20get_output_derivatives)},
  {__Pyx_NAMESTR("get_status"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_23get_status, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_22get_status)},
  {__Pyx_NAMESTR("get_real_status"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_25get_real_status, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_24get_real_status)},
  {__Pyx_NAMESTR("get_integer_status"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_27get_integer_status, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_26get_integer_status)},
  {__Pyx_NAMESTR("get_boolean_status"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_29get_boolean_status, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_28get_boolean_status)},
  {__Pyx_NAMESTR("get_string_status"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_31get_string_status, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_30get_string_status)},
  {__Pyx_NAMESTR("simulate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_33simulate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_32simulate)},
  {__Pyx_NAMESTR("simulate_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_35simulate_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_34simulate_options)},
  {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 *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);
  }
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase2(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelME2[] = {
  {__Pyx_NAMESTR("instantiate_model"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5instantiate_model, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_4instantiate_model)},
  {__Pyx_NAMESTR("initialize"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_7initialize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_6initialize)},
  {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_9reset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_8reset)},
  {__Pyx_NAMESTR("terminate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_11terminate, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_10terminate)},
  {__Pyx_NAMESTR("_get_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_13_get_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_12_get_time)},
  {__Pyx_NAMESTR("_set_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_15_set_time, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_14_set_time)},
  {__Pyx_NAMESTR("get_event_info"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_17get_event_info, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_16get_event_info)},
  {__Pyx_NAMESTR("get_event_indicators"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_19get_event_indicators, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_18get_event_indicators)},
  {__Pyx_NAMESTR("event_update"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_21event_update, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_20event_update)},
  {__Pyx_NAMESTR("get_tolerances"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_23get_tolerances, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_22get_tolerances)},
  {__Pyx_NAMESTR("completed_event_iteration"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_25completed_event_iteration, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_24completed_event_iteration)},
  {__Pyx_NAMESTR("completed_integrator_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_27completed_integrator_step, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_26completed_integrator_step)},
  {__Pyx_NAMESTR("_get_continuous_states"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_29_get_continuous_states, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_28_get_continuous_states)},
  {__Pyx_NAMESTR("_set_continuous_states"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_31_set_continuous_states, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_30_set_continuous_states)},
  {__Pyx_NAMESTR("_get_nominal_continuous_states"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_33_get_nominal_continuous_states, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_32_get_nominal_continuous_states)},
  {__Pyx_NAMESTR("get_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_35get_derivatives, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_34get_derivatives)},
  {__Pyx_NAMESTR("simulate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_37simulate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_36simulate)},
  {__Pyx_NAMESTR("simulate_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_39simulate_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_38simulate_options)},
  {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 = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("fmi"),
    __Pyx_DOCSTR(__pyx_k_368), /* 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_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_106, __pyx_k_106, sizeof(__pyx_k_106), 0, 0, 1, 0},
  {&__pyx_n_s_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 0, 1, 1},
  {&__pyx_n_s_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 1, 1},
  {&__pyx_n_s_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 0, 1, 1},
  {&__pyx_kp_s_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 0, 1, 0},
  {&__pyx_kp_s_116, __pyx_k_116, sizeof(__pyx_k_116), 0, 0, 1, 0},
  {&__pyx_kp_s_118, __pyx_k_118, sizeof(__pyx_k_118), 0, 0, 1, 0},
  {&__pyx_n_s_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 0, 1, 1},
  {&__pyx_kp_s_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 0, 1, 0},
  {&__pyx_kp_s_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 0, 1, 0},
  {&__pyx_n_s_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 1, 1},
  {&__pyx_n_s_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 0, 1, 1},
  {&__pyx_n_s_128, __pyx_k_128, sizeof(__pyx_k_128), 0, 0, 1, 1},
  {&__pyx_n_s_129, __pyx_k_129, sizeof(__pyx_k_129), 0, 0, 1, 1},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_n_s_130, __pyx_k_130, sizeof(__pyx_k_130), 0, 0, 1, 1},
  {&__pyx_n_s_131, __pyx_k_131, sizeof(__pyx_k_131), 0, 0, 1, 1},
  {&__pyx_kp_s_133, __pyx_k_133, sizeof(__pyx_k_133), 0, 0, 1, 0},
  {&__pyx_kp_s_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 0, 1, 0},
  {&__pyx_kp_s_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 1, 0},
  {&__pyx_kp_s_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 0, 1, 0},
  {&__pyx_kp_s_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 1, 0},
  {&__pyx_kp_s_143, __pyx_k_143, sizeof(__pyx_k_143), 0, 0, 1, 0},
  {&__pyx_kp_s_145, __pyx_k_145, sizeof(__pyx_k_145), 0, 0, 1, 0},
  {&__pyx_kp_s_147, __pyx_k_147, sizeof(__pyx_k_147), 0, 0, 1, 0},
  {&__pyx_kp_s_149, __pyx_k_149, sizeof(__pyx_k_149), 0, 0, 1, 0},
  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
  {&__pyx_n_s_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 1, 1},
  {&__pyx_n_s_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 0, 1, 1},
  {&__pyx_kp_s_154, __pyx_k_154, sizeof(__pyx_k_154), 0, 0, 1, 0},
  {&__pyx_n_s_156, __pyx_k_156, sizeof(__pyx_k_156), 0, 0, 1, 1},
  {&__pyx_kp_s_157, __pyx_k_157, sizeof(__pyx_k_157), 0, 0, 1, 0},
  {&__pyx_kp_s_159, __pyx_k_159, sizeof(__pyx_k_159), 0, 0, 1, 0},
  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
  {&__pyx_kp_s_162, __pyx_k_162, sizeof(__pyx_k_162), 0, 0, 1, 0},
  {&__pyx_kp_s_164, __pyx_k_164, sizeof(__pyx_k_164), 0, 0, 1, 0},
  {&__pyx_kp_s_166, __pyx_k_166, sizeof(__pyx_k_166), 0, 0, 1, 0},
  {&__pyx_kp_s_168, __pyx_k_168, sizeof(__pyx_k_168), 0, 0, 1, 0},
  {&__pyx_kp_s_171, __pyx_k_171, sizeof(__pyx_k_171), 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_181, __pyx_k_181, sizeof(__pyx_k_181), 0, 0, 1, 0},
  {&__pyx_kp_s_182, __pyx_k_182, sizeof(__pyx_k_182), 0, 0, 1, 0},
  {&__pyx_kp_s_184, __pyx_k_184, sizeof(__pyx_k_184), 0, 0, 1, 0},
  {&__pyx_kp_s_185, __pyx_k_185, sizeof(__pyx_k_185), 0, 0, 1, 0},
  {&__pyx_kp_s_187, __pyx_k_187, sizeof(__pyx_k_187), 0, 0, 1, 0},
  {&__pyx_kp_s_188, __pyx_k_188, sizeof(__pyx_k_188), 0, 0, 1, 0},
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
  {&__pyx_kp_s_207, __pyx_k_207, sizeof(__pyx_k_207), 0, 0, 1, 0},
  {&__pyx_kp_s_210, __pyx_k_210, sizeof(__pyx_k_210), 0, 0, 1, 0},
  {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
  {&__pyx_n_s_221, __pyx_k_221, sizeof(__pyx_k_221), 0, 0, 1, 1},
  {&__pyx_n_s_222, __pyx_k_222, sizeof(__pyx_k_222), 0, 0, 1, 1},
  {&__pyx_kp_s_224, __pyx_k_224, sizeof(__pyx_k_224), 0, 0, 1, 0},
  {&__pyx_kp_s_227, __pyx_k_227, sizeof(__pyx_k_227), 0, 0, 1, 0},
  {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
  {&__pyx_n_s_230, __pyx_k_230, sizeof(__pyx_k_230), 0, 0, 1, 1},
  {&__pyx_n_s_231, __pyx_k_231, sizeof(__pyx_k_231), 0, 0, 1, 1},
  {&__pyx_n_s_232, __pyx_k_232, sizeof(__pyx_k_232), 0, 0, 1, 1},
  {&__pyx_n_s_233, __pyx_k_233, sizeof(__pyx_k_233), 0, 0, 1, 1},
  {&__pyx_n_s_234, __pyx_k_234, sizeof(__pyx_k_234), 0, 0, 1, 1},
  {&__pyx_n_s_235, __pyx_k_235, sizeof(__pyx_k_235), 0, 0, 1, 1},
  {&__pyx_n_s_236, __pyx_k_236, sizeof(__pyx_k_236), 0, 0, 1, 1},
  {&__pyx_n_s_237, __pyx_k_237, sizeof(__pyx_k_237), 0, 0, 1, 1},
  {&__pyx_n_s_238, __pyx_k_238, sizeof(__pyx_k_238), 0, 0, 1, 1},
  {&__pyx_n_s_239, __pyx_k_239, sizeof(__pyx_k_239), 0, 0, 1, 1},
  {&__pyx_n_s_240, __pyx_k_240, sizeof(__pyx_k_240), 0, 0, 1, 1},
  {&__pyx_n_s_241, __pyx_k_241, sizeof(__pyx_k_241), 0, 0, 1, 1},
  {&__pyx_n_s_242, __pyx_k_242, sizeof(__pyx_k_242), 0, 0, 1, 1},
  {&__pyx_n_s_243, __pyx_k_243, sizeof(__pyx_k_243), 0, 0, 1, 1},
  {&__pyx_n_s_244, __pyx_k_244, sizeof(__pyx_k_244), 0, 0, 1, 1},
  {&__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_247, __pyx_k_247, sizeof(__pyx_k_247), 0, 0, 1, 0},
  {&__pyx_kp_s_249, __pyx_k_249, sizeof(__pyx_k_249), 0, 0, 1, 0},
  {&__pyx_kp_s_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_kp_s_253, __pyx_k_253, sizeof(__pyx_k_253), 0, 0, 1, 0},
  {&__pyx_n_s_257, __pyx_k_257, sizeof(__pyx_k_257), 0, 0, 1, 1},
  {&__pyx_kp_s_258, __pyx_k_258, sizeof(__pyx_k_258), 0, 0, 1, 0},
  {&__pyx_kp_s_261, __pyx_k_261, sizeof(__pyx_k_261), 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_271, __pyx_k_271, sizeof(__pyx_k_271), 0, 0, 1, 0},
  {&__pyx_kp_s_279, __pyx_k_279, sizeof(__pyx_k_279), 0, 0, 1, 0},
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
  {&__pyx_kp_s_281, __pyx_k_281, sizeof(__pyx_k_281), 0, 0, 1, 0},
  {&__pyx_kp_s_295, __pyx_k_295, sizeof(__pyx_k_295), 0, 0, 1, 0},
  {&__pyx_kp_s_299, __pyx_k_299, sizeof(__pyx_k_299), 0, 0, 1, 0},
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
  {&__pyx_n_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 1},
  {&__pyx_n_s_311, __pyx_k_311, sizeof(__pyx_k_311), 0, 0, 1, 1},
  {&__pyx_kp_s_312, __pyx_k_312, sizeof(__pyx_k_312), 0, 0, 1, 0},
  {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
  {&__pyx_kp_s_324, __pyx_k_324, sizeof(__pyx_k_324), 0, 0, 1, 0},
  {&__pyx_kp_s_329, __pyx_k_329, sizeof(__pyx_k_329), 0, 0, 1, 0},
  {&__pyx_kp_s_339, __pyx_k_339, sizeof(__pyx_k_339), 0, 0, 1, 0},
  {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
  {&__pyx_n_s_341, __pyx_k_341, sizeof(__pyx_k_341), 0, 0, 1, 1},
  {&__pyx_kp_s_343, __pyx_k_343, sizeof(__pyx_k_343), 0, 0, 1, 0},
  {&__pyx_kp_s_344, __pyx_k_344, sizeof(__pyx_k_344), 0, 0, 1, 0},
  {&__pyx_kp_s_347, __pyx_k_347, sizeof(__pyx_k_347), 0, 0, 1, 0},
  {&__pyx_kp_s_349, __pyx_k_349, sizeof(__pyx_k_349), 0, 0, 1, 0},
  {&__pyx_kp_s_350, __pyx_k_350, sizeof(__pyx_k_350), 0, 0, 1, 0},
  {&__pyx_kp_s_353, __pyx_k_353, sizeof(__pyx_k_353), 0, 0, 1, 0},
  {&__pyx_kp_s_354, __pyx_k_354, sizeof(__pyx_k_354), 0, 0, 1, 0},
  {&__pyx_kp_u_356, __pyx_k_356, sizeof(__pyx_k_356), 0, 1, 0, 0},
  {&__pyx_kp_u_358, __pyx_k_358, sizeof(__pyx_k_358), 0, 1, 0, 0},
  {&__pyx_kp_u_360, __pyx_k_360, sizeof(__pyx_k_360), 0, 1, 0, 0},
  {&__pyx_kp_u_362, __pyx_k_362, sizeof(__pyx_k_362), 0, 1, 0, 0},
  {&__pyx_kp_u_363, __pyx_k_363, sizeof(__pyx_k_363), 0, 1, 0, 0},
  {&__pyx_kp_u_366, __pyx_k_366, sizeof(__pyx_k_366), 0, 1, 0, 0},
  {&__pyx_n_s_369, __pyx_k_369, sizeof(__pyx_k_369), 0, 0, 1, 1},
  {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0},
  {&__pyx_kp_s_370, __pyx_k_370, sizeof(__pyx_k_370), 0, 0, 1, 0},
  {&__pyx_kp_s_371, __pyx_k_371, sizeof(__pyx_k_371), 0, 0, 1, 0},
  {&__pyx_kp_s_372, __pyx_k_372, sizeof(__pyx_k_372), 0, 0, 1, 0},
  {&__pyx_n_s_373, __pyx_k_373, sizeof(__pyx_k_373), 0, 0, 1, 1},
  {&__pyx_kp_s_374, __pyx_k_374, sizeof(__pyx_k_374), 0, 0, 1, 0},
  {&__pyx_n_s_375, __pyx_k_375, sizeof(__pyx_k_375), 0, 0, 1, 1},
  {&__pyx_n_s_376, __pyx_k_376, sizeof(__pyx_k_376), 0, 0, 1, 1},
  {&__pyx_kp_s_377, __pyx_k_377, sizeof(__pyx_k_377), 0, 0, 1, 0},
  {&__pyx_n_s_378, __pyx_k_378, sizeof(__pyx_k_378), 0, 0, 1, 1},
  {&__pyx_n_s_379, __pyx_k_379, sizeof(__pyx_k_379), 0, 0, 1, 1},
  {&__pyx_n_s_380, __pyx_k_380, sizeof(__pyx_k_380), 0, 0, 1, 1},
  {&__pyx_n_s_381, __pyx_k_381, sizeof(__pyx_k_381), 0, 0, 1, 1},
  {&__pyx_kp_s_382, __pyx_k_382, sizeof(__pyx_k_382), 0, 0, 1, 0},
  {&__pyx_n_s_383, __pyx_k_383, sizeof(__pyx_k_383), 0, 0, 1, 1},
  {&__pyx_kp_s_384, __pyx_k_384, sizeof(__pyx_k_384), 0, 0, 1, 0},
  {&__pyx_kp_s_387, __pyx_k_387, sizeof(__pyx_k_387), 0, 0, 1, 0},
  {&__pyx_n_s_390, __pyx_k_390, sizeof(__pyx_k_390), 0, 0, 1, 1},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_n_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 1},
  {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0},
  {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
  {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
  {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 0},
  {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0},
  {&__pyx_kp_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 0},
  {&__pyx_kp_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 0},
  {&__pyx_kp_s_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 1, 0},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_kp_s_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 1, 0},
  {&__pyx_kp_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 0},
  {&__pyx_kp_s_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 1, 0},
  {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0},
  {&__pyx_n_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 1},
  {&__pyx_n_s_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 1, 1},
  {&__pyx_n_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 1},
  {&__pyx_kp_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 0},
  {&__pyx_kp_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 0},
  {&__pyx_kp_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 0},
  {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0},
  {&__pyx_kp_s_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_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 0, 1, 0},
  {&__pyx_n_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 1},
  {&__pyx_kp_s_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 0, 1, 0},
  {&__pyx_n_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 1},
  {&__pyx_kp_s_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 0, 1, 0},
  {&__pyx_kp_s_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 1, 0},
  {&__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_kp_s_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 0, 1, 0},
  {&__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__CS, __pyx_k__CS, sizeof(__pyx_k__CS), 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__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_FIXED, __pyx_k__FMI2_FIXED, sizeof(__pyx_k__FMI2_FIXED), 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_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_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__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_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_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__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__capabilities_Num, __pyx_k__capabilities_Num, sizeof(__pyx_k__capabilities_Num), 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__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__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__cs_canHandleEvents, __pyx_k__cs_canHandleEvents, sizeof(__pyx_k__cs_canHandleEvents), 0, 0, 1, 1},
  {&__pyx_n_s__cs_canSignalEvents, __pyx_k__cs_canSignalEvents, sizeof(__pyx_k__cs_canSignalEvents), 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__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__endswith, __pyx_k__endswith, sizeof(__pyx_k__endswith), 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__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_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_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_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__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__input, __pyx_k__input, sizeof(__pyx_k__input), 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__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__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__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__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__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__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__relTol, __pyx_k__relTol, sizeof(__pyx_k__relTol), 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__sorted, __pyx_k__sorted, sizeof(__pyx_k__sorted), 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__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__strip, __pyx_k__strip, sizeof(__pyx_k__strip), 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__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__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__variablename, __pyx_k__variablename, sizeof(__pyx_k__variablename), 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__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 = 273; __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 = 309; __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 = 125; __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 = 163; __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 = 166; __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 = 166; __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 = 209; __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 = 613; __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 = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_sorted = __Pyx_GetName(__pyx_b, __pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4574; __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 = 214; __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 = 798; __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":125
 * #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_2 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_2);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_2, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_2, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));

  /* "pyfmi\fmi.pyx":531
 *                 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_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_17);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
  PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));

  /* "pyfmi\fmi.pyx":540
 * 
 *         # 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_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_19);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
  PyTuple_SET_ITEM(__pyx_k_tuple_19, 0, ((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));

  /* "pyfmi\fmi.pyx":541
 *         # 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_21 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_21);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
  PyTuple_SET_ITEM(__pyx_k_tuple_21, 0, ((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));

  /* "pyfmi\fmi.pyx":561
 *                 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_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_24);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_23));
  PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_kp_s_23));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));

  /* "pyfmi\fmi.pyx":563
 *                 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_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_26);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
  PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_kp_s_25));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));

  /* "pyfmi\fmi.pyx":572
 *                 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_29 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_29);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_28));
  PyTuple_SET_ITEM(__pyx_k_tuple_29, 0, ((PyObject *)__pyx_kp_s_28));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29));

  /* "pyfmi\fmi.pyx":578
 *         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_30 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_30);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 0, ((PyObject *)__pyx_kp_s_25));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));

  /* "pyfmi\fmi.pyx":589
 *                 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_33 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_33);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_32));
  PyTuple_SET_ITEM(__pyx_k_tuple_33, 0, ((PyObject *)__pyx_kp_s_32));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33));

  /* "pyfmi\fmi.pyx":612
 * 
 *         #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_35 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_35);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_35, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_35, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));

  /* "pyfmi\fmi.pyx":620
 *     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_36 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_36);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_36, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_36, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_36, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36));

  /* "pyfmi\fmi.pyx":645
 *                     if line == "":
 *                         break
 *                     log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 *         return log
 * 
 */
  __pyx_k_tuple_38 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_38);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_37));
  PyTuple_SET_ITEM(__pyx_k_tuple_38, 0, ((PyObject *)__pyx_kp_s_37));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));

  /* "pyfmi\fmi.pyx":640
 *         log = []
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     line = file.readline()
 */
  __pyx_k_tuple_39 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_39);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_39, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_39, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_39, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39));

  /* "pyfmi\fmi.pyx":681
 *                 regexp.append(re.compile(regex))
 *         else:
 *             raise FMUException("Unknown input.")             # <<<<<<<<<<<<<<
 *         return regexp
 * 
 */
  __pyx_k_tuple_42 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_42);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_41));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 0, ((PyObject *)__pyx_kp_s_41));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42));

  /* "pyfmi\fmi.pyx":751
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
  __pyx_k_tuple_44 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_44);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_43));
  PyTuple_SET_ITEM(__pyx_k_tuple_44, 0, ((PyObject *)__pyx_kp_s_43));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44));

  /* "pyfmi\fmi.pyx":780
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_46 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_46);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
  PyTuple_SET_ITEM(__pyx_k_tuple_46, 0, ((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46));

  /* "pyfmi\fmi.pyx":786
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
  __pyx_k_tuple_48 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_48);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_47));
  PyTuple_SET_ITEM(__pyx_k_tuple_48, 0, ((PyObject *)__pyx_kp_s_47));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_47));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_48));

  /* "pyfmi\fmi.pyx":818
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
  __pyx_k_tuple_50 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_50);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_49));
  PyTuple_SET_ITEM(__pyx_k_tuple_50, 0, ((PyObject *)__pyx_kp_s_49));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_49));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50));

  /* "pyfmi\fmi.pyx":848
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_51 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_51);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
  PyTuple_SET_ITEM(__pyx_k_tuple_51, 0, ((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));

  /* "pyfmi\fmi.pyx":854
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_53 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_53);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_52));
  PyTuple_SET_ITEM(__pyx_k_tuple_53, 0, ((PyObject *)__pyx_kp_s_52));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_52));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53));

  /* "pyfmi\fmi.pyx":900
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         return N.array(return_values)
 */
  __pyx_k_tuple_55 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_55);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_54));
  PyTuple_SET_ITEM(__pyx_k_tuple_55, 0, ((PyObject *)__pyx_kp_s_54));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_54));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55));

  /* "pyfmi\fmi.pyx":942
 * 
 *         if val_ref.size != values.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_56 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_56);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
  PyTuple_SET_ITEM(__pyx_k_tuple_56, 0, ((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));

  /* "pyfmi\fmi.pyx":951
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
  __pyx_k_tuple_58 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_58);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_57));
  PyTuple_SET_ITEM(__pyx_k_tuple_58, 0, ((PyObject *)__pyx_kp_s_57));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_57));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58));

  /* "pyfmi\fmi.pyx":1059
 * 
 *         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_60 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_60);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_59));
  PyTuple_SET_ITEM(__pyx_k_tuple_60, 0, ((PyObject *)__pyx_kp_s_59));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_59));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_60));

  /* "pyfmi\fmi.pyx":1081
 *         """
 *         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_62 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_62);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_61));
  PyTuple_SET_ITEM(__pyx_k_tuple_62, 0, ((PyObject *)__pyx_kp_s_61));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_61));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62));

  /* "pyfmi\fmi.pyx":1085
 * 
 *     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_64 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_64);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_63));
  PyTuple_SET_ITEM(__pyx_k_tuple_64, 0, ((PyObject *)__pyx_kp_s_63));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_63));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_64));

  /* "pyfmi\fmi.pyx":1120
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_67 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_67);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_66));
  PyTuple_SET_ITEM(__pyx_k_tuple_67, 0, ((PyObject *)__pyx_kp_s_66));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_66));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));

  /* "pyfmi\fmi.pyx":1152
 *             return not value if alias_kind == FMI_NEGATED_ALIAS else value
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_description(self, char* variablename):
 */
  __pyx_k_tuple_68 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_68);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_66));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 0, ((PyObject *)__pyx_kp_s_66));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_66));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));

  /* "pyfmi\fmi.pyx":1253
 *                 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_74 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_74);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_73));
  PyTuple_SET_ITEM(__pyx_k_tuple_74, 0, ((PyObject *)__pyx_kp_s_73));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_73));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_74));

  /* "pyfmi\fmi.pyx":1257
 *         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_76 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_76);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_75));
  PyTuple_SET_ITEM(__pyx_k_tuple_76, 0, ((PyObject *)__pyx_kp_s_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_76));

  /* "pyfmi\fmi.pyx":1348
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self,char* variablename):
 */
  __pyx_k_tuple_79 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_79);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_78));
  PyTuple_SET_ITEM(__pyx_k_tuple_79, 0, ((PyObject *)__pyx_kp_s_78));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_78));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_79));

  /* "pyfmi\fmi.pyx":1388
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self,char* variablename):
 */
  __pyx_k_tuple_81 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_81);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_80));
  PyTuple_SET_ITEM(__pyx_k_tuple_81, 0, ((PyObject *)__pyx_kp_s_80));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_80));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_81));

  /* "pyfmi\fmi.pyx":1428
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_83 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_83);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_82));
  PyTuple_SET_ITEM(__pyx_k_tuple_83, 0, ((PyObject *)__pyx_kp_s_82));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_82));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_83));

  /* "pyfmi\fmi.pyx":1855
 * 
 *         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_92 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_92);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_91));
  PyTuple_SET_ITEM(__pyx_k_tuple_92, 0, ((PyObject *)__pyx_kp_s_91));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_91));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_92));

  /* "pyfmi\fmi.pyx":1983
 *                 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_96 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_96);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_95));
  PyTuple_SET_ITEM(__pyx_k_tuple_96, 0, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_96));

  /* "pyfmi\fmi.pyx":1990
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_98 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_98);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_97));
  PyTuple_SET_ITEM(__pyx_k_tuple_98, 0, ((PyObject *)__pyx_kp_s_97));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_97));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98));

  /* "pyfmi\fmi.pyx":2038
 * 
 *         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_100 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_100);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_99));
  PyTuple_SET_ITEM(__pyx_k_tuple_100, 0, ((PyObject *)__pyx_kp_s_99));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_99));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_100));

  /* "pyfmi\fmi.pyx":2046
 *         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_102 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_102);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_101));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 0, ((PyObject *)__pyx_kp_s_101));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_101));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_102));

  /* "pyfmi\fmi.pyx":2048
 *                 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_104 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_104);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_103));
  PyTuple_SET_ITEM(__pyx_k_tuple_104, 0, ((PyObject *)__pyx_kp_s_103));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_103));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_104));

  /* "pyfmi\fmi.pyx":2058
 *                 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_105 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_105);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_95));
  PyTuple_SET_ITEM(__pyx_k_tuple_105, 0, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_105));

  /* "pyfmi\fmi.pyx":2063
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
  __pyx_k_tuple_107 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_107);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_106));
  PyTuple_SET_ITEM(__pyx_k_tuple_107, 0, ((PyObject *)__pyx_kp_s_106));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_106));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_107));

  /* "pyfmi\fmi.pyx":2179
 * 
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("The slave failed to initialize. See the log for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *         self._allocated_fmu = True
 */
  __pyx_k_tuple_117 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_117);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_116));
  PyTuple_SET_ITEM(__pyx_k_tuple_117, 0, ((PyObject *)__pyx_kp_s_116));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_116));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_117));

  /* "pyfmi\fmi.pyx":2191
 *         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_119 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_119);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_118));
  PyTuple_SET_ITEM(__pyx_k_tuple_119, 0, ((PyObject *)__pyx_kp_s_118));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_118));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_119));

  /* "pyfmi\fmi.pyx":2230
 * 
 *         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_123 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_123);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_122));
  PyTuple_SET_ITEM(__pyx_k_tuple_123, 0, ((PyObject *)__pyx_kp_s_122));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_122));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_123));

  /* "pyfmi\fmi.pyx":2237
 * 
 *         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_125 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_125);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_124));
  PyTuple_SET_ITEM(__pyx_k_tuple_125, 0, ((PyObject *)__pyx_kp_s_124));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_124));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_125));

  /* "pyfmi\fmi.pyx":2282
 * 
 *         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_134 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_134);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_133));
  PyTuple_SET_ITEM(__pyx_k_tuple_134, 0, ((PyObject *)__pyx_kp_s_133));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_133));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_134));

  /* "pyfmi\fmi.pyx":2320
 *         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_136 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_136);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_135));
  PyTuple_SET_ITEM(__pyx_k_tuple_136, 0, ((PyObject *)__pyx_kp_s_135));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_135));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_136));

  /* "pyfmi\fmi.pyx":2371
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 * 
 *     time = property(_get_time,_set_time, doc =
 */
  __pyx_k_tuple_138 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_138);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_137));
  PyTuple_SET_ITEM(__pyx_k_tuple_138, 0, ((PyObject *)__pyx_kp_s_137));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_137));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_138));

  /* "pyfmi\fmi.pyx":2385
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_140 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_140);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_139));
  PyTuple_SET_ITEM(__pyx_k_tuple_140, 0, ((PyObject *)__pyx_kp_s_139));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_139));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_140));

  /* "pyfmi\fmi.pyx":2394
 * 
 *         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_142 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_142);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_141));
  PyTuple_SET_ITEM(__pyx_k_tuple_142, 0, ((PyObject *)__pyx_kp_s_141));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_141));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142));

  /* "pyfmi\fmi.pyx":2402
 * 
 *         if status >= 3:
 *             raise FMUException('Failed to set the new continuous states.')             # <<<<<<<<<<<<<<
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,
 */
  __pyx_k_tuple_144 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_144);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_143));
  PyTuple_SET_ITEM(__pyx_k_tuple_144, 0, ((PyObject *)__pyx_kp_s_143));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_143));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_144));

  /* "pyfmi\fmi.pyx":2419
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_146 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_146);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_145));
  PyTuple_SET_ITEM(__pyx_k_tuple_146, 0, ((PyObject *)__pyx_kp_s_145));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_145));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_146));

  /* "pyfmi\fmi.pyx":2450
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the derivative values.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_148 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_148);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_147));
  PyTuple_SET_ITEM(__pyx_k_tuple_148, 0, ((PyObject *)__pyx_kp_s_147));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_147));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_148));

  /* "pyfmi\fmi.pyx":2475
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_150 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_150);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_149));
  PyTuple_SET_ITEM(__pyx_k_tuple_150, 0, ((PyObject *)__pyx_kp_s_149));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_149));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_150));

  /* "pyfmi\fmi.pyx":2537
 * 
 *         if status != 0:
 *             raise FMUException('Failed to update the events.')             # <<<<<<<<<<<<<<
 * 
 *     def get_event_info(self):
 */
  __pyx_k_tuple_155 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_155);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_154));
  PyTuple_SET_ITEM(__pyx_k_tuple_155, 0, ((PyObject *)__pyx_kp_s_154));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_154));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_155));

  /* "pyfmi\fmi.pyx":2602
 * 
 *         if status != 0:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to get the continuous state reference values.')
 * 
 */
  __pyx_k_tuple_158 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_158);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_157));
  PyTuple_SET_ITEM(__pyx_k_tuple_158, 0, ((PyObject *)__pyx_kp_s_157));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_157));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_158));

  /* "pyfmi\fmi.pyx":2626
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         if callEventUpdate == 1:
 */
  __pyx_k_tuple_160 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_160);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_159));
  PyTuple_SET_ITEM(__pyx_k_tuple_160, 0, ((PyObject *)__pyx_kp_s_159));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_159));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_160));

  /* "pyfmi\fmi.pyx":2673
 *         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_163 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_163);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_162));
  PyTuple_SET_ITEM(__pyx_k_tuple_163, 0, ((PyObject *)__pyx_kp_s_162));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_162));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_163));

  /* "pyfmi\fmi.pyx":2677
 *                     ' 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_165 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_165);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_164));
  PyTuple_SET_ITEM(__pyx_k_tuple_165, 0, ((PyObject *)__pyx_kp_s_164));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_164));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_165));

  /* "pyfmi\fmi.pyx":2682
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with a error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_k_tuple_167 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_167);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_166));
  PyTuple_SET_ITEM(__pyx_k_tuple_167, 0, ((PyObject *)__pyx_kp_s_166));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_166));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_167));

  /* "pyfmi\fmi.pyx":2686
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Initialize returned with a error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_k_tuple_169 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_169)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_169);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_168));
  PyTuple_SET_ITEM(__pyx_k_tuple_169, 0, ((PyObject *)__pyx_kp_s_168));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_168));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_169));

  /* "pyfmi\fmi.pyx":2719
 * 
 *         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_172 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_172)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_172);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_171));
  PyTuple_SET_ITEM(__pyx_k_tuple_172, 0, ((PyObject *)__pyx_kp_s_171));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_171));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_172));

  /* "pyfmi\fmi.pyx":2726
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
  __pyx_k_tuple_173 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_173);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_124));
  PyTuple_SET_ITEM(__pyx_k_tuple_173, 0, ((PyObject *)__pyx_kp_s_124));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_124));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_173));

  /* "pyfmi\fmi.pyx":2910
 *         # Check that the file referenced by fmu has the correct file-ending
 *         self._fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *         if not self._fmu_full_path.endswith('.fmu'):             # <<<<<<<<<<<<<<
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_k_tuple_176 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_176)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_176);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
  PyTuple_SET_ITEM(__pyx_k_tuple_176, 0, ((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_176));

  /* "pyfmi\fmi.pyx":2911
 *         self._fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *         if not self._fmu_full_path.endswith('.fmu'):
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *         #Check that the file exists
 */
  __pyx_k_tuple_177 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_177)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_177);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
  PyTuple_SET_ITEM(__pyx_k_tuple_177, 0, ((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_177));

  /* "pyfmi\fmi.pyx":2915
 *         #Check that the file exists
 *         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_179 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_179)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_179);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_178));
  PyTuple_SET_ITEM(__pyx_k_tuple_179, 0, ((PyObject *)__pyx_kp_s_178));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_178));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_179));

  /* "pyfmi\fmi.pyx":2931
 *                 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_180 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_180)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_180);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_23));
  PyTuple_SET_ITEM(__pyx_k_tuple_180, 0, ((PyObject *)__pyx_kp_s_23));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_180));

  /* "pyfmi\fmi.pyx":2938
 *                 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_183 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_183)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_183);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_182));
  PyTuple_SET_ITEM(__pyx_k_tuple_183, 0, ((PyObject *)__pyx_kp_s_182));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_182));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_183));

  /* "pyfmi\fmi.pyx":2948
 *                 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_186 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_186)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_186);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_185));
  PyTuple_SET_ITEM(__pyx_k_tuple_186, 0, ((PyObject *)__pyx_kp_s_185));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_185));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_186));

  /* "pyfmi\fmi.pyx":2960
 *                 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_k_tuple_189 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_189)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_189);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_188));
  PyTuple_SET_ITEM(__pyx_k_tuple_189, 0, ((PyObject *)__pyx_kp_s_188));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_188));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_189));

  /* "pyfmi\fmi.pyx":2970
 *                 raise FMUException(last_error)
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         self._allocated_dll = True
 * 
 */
  __pyx_k_tuple_190 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_190)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_190);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_32));
  PyTuple_SET_ITEM(__pyx_k_tuple_190, 0, ((PyObject *)__pyx_kp_s_32));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_32));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_190));

  /* "pyfmi\fmi.pyx":2981
 * 
 *         #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_191 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_191)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_191);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_191, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_191, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_191, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_191));

  /* "pyfmi\fmi.pyx":3019
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
  __pyx_k_tuple_192 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_192)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_192);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_43));
  PyTuple_SET_ITEM(__pyx_k_tuple_192, 0, ((PyObject *)__pyx_kp_s_43));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_192));

  /* "pyfmi\fmi.pyx":3050
 * 
 *         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_193 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_193)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_193);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
  PyTuple_SET_ITEM(__pyx_k_tuple_193, 0, ((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_193));

  /* "pyfmi\fmi.pyx":3055
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
  __pyx_k_tuple_194 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_194)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_194);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_47));
  PyTuple_SET_ITEM(__pyx_k_tuple_194, 0, ((PyObject *)__pyx_kp_s_47));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_47));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_194));

  /* "pyfmi\fmi.pyx":3088
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
  __pyx_k_tuple_195 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_195)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_195);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_49));
  PyTuple_SET_ITEM(__pyx_k_tuple_195, 0, ((PyObject *)__pyx_kp_s_49));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_49));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_195));

  /* "pyfmi\fmi.pyx":3119
 * 
 *         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_196 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_196)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_196);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
  PyTuple_SET_ITEM(__pyx_k_tuple_196, 0, ((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_196));

  /* "pyfmi\fmi.pyx":3124
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_boolean(self, valueref):
 */
  __pyx_k_tuple_197 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_197)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_197);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_52));
  PyTuple_SET_ITEM(__pyx_k_tuple_197, 0, ((PyObject *)__pyx_kp_s_52));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_52));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_197));

  /* "pyfmi\fmi.pyx":3170
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         #return val==FMI_TRUE
 */
  __pyx_k_tuple_198 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_198)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_198);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_54));
  PyTuple_SET_ITEM(__pyx_k_tuple_198, 0, ((PyObject *)__pyx_kp_s_54));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_54));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_198));

  /* "pyfmi\fmi.pyx":3212
 * 
 *         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_199 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_199)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_199);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
  PyTuple_SET_ITEM(__pyx_k_tuple_199, 0, ((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_199));

  /* "pyfmi\fmi.pyx":3220
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
  __pyx_k_tuple_200 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_200)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_200);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_57));
  PyTuple_SET_ITEM(__pyx_k_tuple_200, 0, ((PyObject *)__pyx_kp_s_57));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_57));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_200));

  /* "pyfmi\fmi.pyx":3313
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     def _get(self,char* variable_name):
 */
  __pyx_k_tuple_201 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_201)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_201);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_66));
  PyTuple_SET_ITEM(__pyx_k_tuple_201, 0, ((PyObject *)__pyx_kp_s_66));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_66));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_201));

  /* "pyfmi\fmi.pyx":3334
 *             return self.get_boolean([ref])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_202 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_202)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_202);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_66));
  PyTuple_SET_ITEM(__pyx_k_tuple_202, 0, ((PyObject *)__pyx_kp_s_66));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_66));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_202));

  /* "pyfmi\fmi.pyx":3343
 *         #print "FMIL: module = %s, log level = %d: %s"%(module, log_level, message)
 *         if self._fmu_log_name != "":
 *             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_203 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_203)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_203);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_203, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_203, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_203, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_203));

  /* "pyfmi\fmi.pyx":3368
 *                     if line == "":
 *                         break
 *                     log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 *             return log
 *         else:
 */
  __pyx_k_tuple_204 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_204)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_204);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_37));
  PyTuple_SET_ITEM(__pyx_k_tuple_204, 0, ((PyObject *)__pyx_kp_s_37));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_204));

  /* "pyfmi\fmi.pyx":3363
 *         log = []
 *         if self._fmu_log_name != "":
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     line = file.readline()
 */
  __pyx_k_tuple_205 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_205)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_205);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_205, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_205, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_205, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_205));

  /* "pyfmi\fmi.pyx":3404
 *         """
 *         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_206 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_206)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_206);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_61));
  PyTuple_SET_ITEM(__pyx_k_tuple_206, 0, ((PyObject *)__pyx_kp_s_61));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_61));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_206));

  /* "pyfmi\fmi.pyx":3420
 *             return level
 *         else:
 *             raise FMUException('Logging is not enabled')             # <<<<<<<<<<<<<<
 * 
 *     def set_debug_logging(self, logging_on, categories = []):
 */
  __pyx_k_tuple_208 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_208)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_208);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_207));
  PyTuple_SET_ITEM(__pyx_k_tuple_208, 0, ((PyObject *)__pyx_kp_s_207));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_207));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_208));

  /* "pyfmi\fmi.pyx":3453
 * 
 *         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_211 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_211)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_211);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_210));
  PyTuple_SET_ITEM(__pyx_k_tuple_211, 0, ((PyObject *)__pyx_kp_s_210));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_210));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_211));

  /* "pyfmi\fmi.pyx":3458
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def get_categories(self):
 */
  __pyx_k_tuple_212 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_212);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_59));
  PyTuple_SET_ITEM(__pyx_k_tuple_212, 0, ((PyObject *)__pyx_kp_s_59));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_59));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_212));

  /* "pyfmi\fmi.pyx":3512
 *                 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_213 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_213);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_73));
  PyTuple_SET_ITEM(__pyx_k_tuple_213, 0, ((PyObject *)__pyx_kp_s_73));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_73));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_213));

  /* "pyfmi\fmi.pyx":3516
 *         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_214 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_214)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_214);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_75));
  PyTuple_SET_ITEM(__pyx_k_tuple_214, 0, ((PyObject *)__pyx_kp_s_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_214));

  /* "pyfmi\fmi.pyx":4064
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self, char* variablename):
 */
  __pyx_k_tuple_218 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_218)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_218);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_78));
  PyTuple_SET_ITEM(__pyx_k_tuple_218, 0, ((PyObject *)__pyx_kp_s_78));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_78));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_218));

  /* "pyfmi\fmi.pyx":4104
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self, char* variablename):
 */
  __pyx_k_tuple_219 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_219)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_219);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_80));
  PyTuple_SET_ITEM(__pyx_k_tuple_219, 0, ((PyObject *)__pyx_kp_s_80));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_80));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_219));

  /* "pyfmi\fmi.pyx":4144
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_220 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_220)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_220);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_82));
  PyTuple_SET_ITEM(__pyx_k_tuple_220, 0, ((PyObject *)__pyx_kp_s_82));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_82));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_220));

  /* "pyfmi\fmi.pyx":4407
 *                 regexp.append(re.compile(regex))
 *         else:
 *             raise FMUException("Unknown input.")             # <<<<<<<<<<<<<<
 *         return regexp
 * 
 */
  __pyx_k_tuple_223 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_223)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_223);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_41));
  PyTuple_SET_ITEM(__pyx_k_tuple_223, 0, ((PyObject *)__pyx_kp_s_41));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_223));

  /* "pyfmi\fmi.pyx":4450
 *         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_225 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_225)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_225);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_224));
  PyTuple_SET_ITEM(__pyx_k_tuple_225, 0, ((PyObject *)__pyx_kp_s_224));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_224));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_225));

  /* "pyfmi\fmi.pyx":4471
 *         variable_list = FMIL.fmi2_import_get_states_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_226 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_226)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_226);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_224));
  PyTuple_SET_ITEM(__pyx_k_tuple_226, 0, ((PyObject *)__pyx_kp_s_224));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_224));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_226));

  /* "pyfmi\fmi.pyx":4492
 *         input_list = FMIL.fmi2_import_get_inputs_list(self._fmu)
 *         if input_list == NULL:
 *             raise FMUException("The returned input list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         variable_dict = self._add_scalar_variables(input_list)
 */
  __pyx_k_tuple_228 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_228)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_228);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_227));
  PyTuple_SET_ITEM(__pyx_k_tuple_228, 0, ((PyObject *)__pyx_kp_s_227));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_227));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_228));

  /* "pyfmi\fmi.pyx":4513
 *         output_list = FMIL.fmi2_import_get_outputs_list(self._fmu)
 *         if output_list == NULL:
 *             raise FMUException("The returned input list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         variable_dict = self._add_scalar_variables(output_list)
 */
  __pyx_k_tuple_229 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_229)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_229);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_227));
  PyTuple_SET_ITEM(__pyx_k_tuple_229, 0, ((PyObject *)__pyx_kp_s_227));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_227));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_229));

  /* "pyfmi\fmi.pyx":4586
 * 
 *         else:
 *             raise FMUException('The instance is not curent an instance of an ME-model or a CS-model. Use load_fmu for correct loading.')             # <<<<<<<<<<<<<<
 * 
 *     def get_directional_derivative(self, var_ref, func_ref, v):
 */
  __pyx_k_tuple_248 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_248)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_248);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_247));
  PyTuple_SET_ITEM(__pyx_k_tuple_248, 0, ((PyObject *)__pyx_kp_s_247));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_247));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_248));

  /* "pyfmi\fmi.pyx":4647
 * 
 *         if not FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives):
 *             raise FMUException('This FMU does not provide directional derivatives')             # <<<<<<<<<<<<<<
 * 
 *         if len(var_ref) != len(v):
 */
  __pyx_k_tuple_250 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_250)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_250);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_249));
  PyTuple_SET_ITEM(__pyx_k_tuple_250, 0, ((PyObject *)__pyx_kp_s_249));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_249));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_250));

  /* "pyfmi\fmi.pyx":4650
 * 
 *         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_252 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_252)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_252);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_251));
  PyTuple_SET_ITEM(__pyx_k_tuple_252, 0, ((PyObject *)__pyx_kp_s_251));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_251));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_252));

  /* "pyfmi\fmi.pyx":4664
 * 
 *         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_254 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_254)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_254);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_253));
  PyTuple_SET_ITEM(__pyx_k_tuple_254, 0, ((PyObject *)__pyx_kp_s_253));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_253));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_254));

  /* "pyfmi\fmi.pyx":4776
 *         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 1.0 for Co-simulation.")             # <<<<<<<<<<<<<<
 * 
 *         if self.get_capability_flags()['cs_needsExecutionTool'] == True:
 */
  __pyx_k_tuple_256 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_256);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_91));
  PyTuple_SET_ITEM(__pyx_k_tuple_256, 0, ((PyObject *)__pyx_kp_s_91));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_91));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_256));

  /* "pyfmi\fmi.pyx":4779
 * 
 *         if self.get_capability_flags()['cs_needsExecutionTool'] == True:
 *             raise FMUException('Models that need an execution tool are not supported')             # <<<<<<<<<<<<<<
 * 
 *         self._modelId = FMIL.fmi2_import_get_model_identifier_CS(self._fmu)
 */
  __pyx_k_tuple_259 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_259)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_259);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_258));
  PyTuple_SET_ITEM(__pyx_k_tuple_259, 0, ((PyObject *)__pyx_kp_s_258));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_258));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_259));

  /* "pyfmi\fmi.pyx":4831
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the slave.')             # <<<<<<<<<<<<<<
 * 
 *     def initialize(self, tStart=0.0, tStop=1.0, StopTimeDefined=False, relTol=None):
 */
  __pyx_k_tuple_262 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_262)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_262);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_261));
  PyTuple_SET_ITEM(__pyx_k_tuple_262, 0, ((PyObject *)__pyx_kp_s_261));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_261));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_262));

  /* "pyfmi\fmi.pyx":4876
 * 
 *         if status != FMIL.fmi2_status_ok:
 *             raise FMUException("The slave failed to initialize.")             # <<<<<<<<<<<<<<
 * 
 *         self._allocated_fmu = True
 */
  __pyx_k_tuple_267 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_267)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_267);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_266));
  PyTuple_SET_ITEM(__pyx_k_tuple_267, 0, ((PyObject *)__pyx_kp_s_266));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_266));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_267));

  /* "pyfmi\fmi.pyx":4891
 *         status = FMIL.fmi2_import_reset_slave(self._fmu)
 *         if status != 0:
 *             raise FMUException('An error occured when reseting the slave, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_k_tuple_269 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_269)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_269);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_268));
  PyTuple_SET_ITEM(__pyx_k_tuple_269, 0, ((PyObject *)__pyx_kp_s_268));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_268));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_269));

  /* "pyfmi\fmi.pyx":4983
 *         status = FMIL.fmi2_import_cancel_step(self._fmu)
 *         if status != 0:
 *             raise FMUException('An error occured while canceling the step')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_272 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_272)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_272);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_271));
  PyTuple_SET_ITEM(__pyx_k_tuple_272, 0, ((PyObject *)__pyx_kp_s_271));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_271));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_272));

  /* "pyfmi\fmi.pyx":5016
 * 
 *         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_273 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_273)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_273);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_101));
  PyTuple_SET_ITEM(__pyx_k_tuple_273, 0, ((PyObject *)__pyx_kp_s_101));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_101));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_273));

  /* "pyfmi\fmi.pyx":5018
 *             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_274 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_274)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_274);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_103));
  PyTuple_SET_ITEM(__pyx_k_tuple_274, 0, ((PyObject *)__pyx_kp_s_103));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_103));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_274));

  /* "pyfmi\fmi.pyx":5029
 *                 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_275 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_275)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_275);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_95));
  PyTuple_SET_ITEM(__pyx_k_tuple_275, 0, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_275));

  /* "pyfmi\fmi.pyx":5035
 * 
 *         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_276 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_276)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_276);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_106));
  PyTuple_SET_ITEM(__pyx_k_tuple_276, 0, ((PyObject *)__pyx_kp_s_106));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_106));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_276));

  /* "pyfmi\fmi.pyx":5081
 *                 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_277 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_277)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_277);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_95));
  PyTuple_SET_ITEM(__pyx_k_tuple_277, 0, ((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_95));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_277));

  /* "pyfmi\fmi.pyx":5089
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_278 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_278)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_278);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_97));
  PyTuple_SET_ITEM(__pyx_k_tuple_278, 0, ((PyObject *)__pyx_kp_s_97));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_97));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_278));

  /* "pyfmi\fmi.pyx":5124
 *             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_280 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_280)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_280);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_279));
  PyTuple_SET_ITEM(__pyx_k_tuple_280, 0, ((PyObject *)__pyx_kp_s_279));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_279));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_280));

  /* "pyfmi\fmi.pyx":5128
 *         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_282 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_282)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_282);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_281));
  PyTuple_SET_ITEM(__pyx_k_tuple_282, 0, ((PyObject *)__pyx_kp_s_281));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_281));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_282));

  /* "pyfmi\fmi.pyx":5156
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_283 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_283)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_283);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_279));
  PyTuple_SET_ITEM(__pyx_k_tuple_283, 0, ((PyObject *)__pyx_kp_s_279));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_279));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_283));

  /* "pyfmi\fmi.pyx":5161
 *         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_284 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_284)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_284);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_281));
  PyTuple_SET_ITEM(__pyx_k_tuple_284, 0, ((PyObject *)__pyx_kp_s_281));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_281));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_284));

  /* "pyfmi\fmi.pyx":5189
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_285 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_285)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_285);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_279));
  PyTuple_SET_ITEM(__pyx_k_tuple_285, 0, ((PyObject *)__pyx_kp_s_279));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_279));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_285));

  /* "pyfmi\fmi.pyx":5194
 *         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_286 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_286)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_286);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_281));
  PyTuple_SET_ITEM(__pyx_k_tuple_286, 0, ((PyObject *)__pyx_kp_s_281));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_281));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_286));

  /* "pyfmi\fmi.pyx":5222
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_287 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_287)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_287);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_279));
  PyTuple_SET_ITEM(__pyx_k_tuple_287, 0, ((PyObject *)__pyx_kp_s_279));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_279));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_287));

  /* "pyfmi\fmi.pyx":5227
 *         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_288 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_288)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_288);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_281));
  PyTuple_SET_ITEM(__pyx_k_tuple_288, 0, ((PyObject *)__pyx_kp_s_281));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_281));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_288));

  /* "pyfmi\fmi.pyx":5255
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_289 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_289)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_289);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_279));
  PyTuple_SET_ITEM(__pyx_k_tuple_289, 0, ((PyObject *)__pyx_kp_s_279));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_279));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_289));

  /* "pyfmi\fmi.pyx":5260
 *         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_290 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_290)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_290);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_281));
  PyTuple_SET_ITEM(__pyx_k_tuple_290, 0, ((PyObject *)__pyx_kp_s_281));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_281));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_290));

  /* "pyfmi\fmi.pyx":5387
 *         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()['me_needsExecutionTool'] == True:
 */
  __pyx_k_tuple_296 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_296)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_296);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_295));
  PyTuple_SET_ITEM(__pyx_k_tuple_296, 0, ((PyObject *)__pyx_kp_s_295));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_295));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_296));

  /* "pyfmi\fmi.pyx":5390
 * 
 *         if self.get_capability_flags()['me_needsExecutionTool'] == True:
 *             raise FMUException('Models that need an execution tool are not supported')             # <<<<<<<<<<<<<<
 * 
 *         self._modelId = FMIL.fmi2_import_get_model_identifier_ME(self._fmu)
 */
  __pyx_k_tuple_297 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_297)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_297);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_258));
  PyTuple_SET_ITEM(__pyx_k_tuple_297, 0, ((PyObject *)__pyx_kp_s_258));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_258));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_297));

  /* "pyfmi\fmi.pyx":5446
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the model.')             # <<<<<<<<<<<<<<
 * 
 *     def initialize(self, tolControlled = True, relativeTolerance = None):
 */
  __pyx_k_tuple_300 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_300)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_300);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_299));
  PyTuple_SET_ITEM(__pyx_k_tuple_300, 0, ((PyObject *)__pyx_kp_s_299));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_299));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_300));

  /* "pyfmi\fmi.pyx":5490
 *         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_302 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_302)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_302);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_162));
  PyTuple_SET_ITEM(__pyx_k_tuple_302, 0, ((PyObject *)__pyx_kp_s_162));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_162));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_302));

  /* "pyfmi\fmi.pyx":5494
 *                     ' 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_303 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_303)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_303);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_164));
  PyTuple_SET_ITEM(__pyx_k_tuple_303, 0, ((PyObject *)__pyx_kp_s_164));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_164));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_303));

  /* "pyfmi\fmi.pyx":5499
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with a error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_k_tuple_304 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_304)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_304);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_166));
  PyTuple_SET_ITEM(__pyx_k_tuple_304, 0, ((PyObject *)__pyx_kp_s_166));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_166));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_304));

  /* "pyfmi\fmi.pyx":5503
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Initialize returned with a error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_k_tuple_305 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_305)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_305);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_168));
  PyTuple_SET_ITEM(__pyx_k_tuple_305, 0, ((PyObject *)__pyx_kp_s_168));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_168));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_305));

  /* "pyfmi\fmi.pyx":5523
 *         status = FMIL.fmi2_import_create_dllfmu(self._fmu, self._fmu_kind, &self.callBackFunctions)
 *         if status == FMIL.jm_status_error:
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_k_tuple_306 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_306)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_306);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_135));
  PyTuple_SET_ITEM(__pyx_k_tuple_306, 0, ((PyObject *)__pyx_kp_s_135));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_135));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_306));

  /* "pyfmi\fmi.pyx":5564
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 *         self.__t = t
 * 
 */
  __pyx_k_tuple_307 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_307)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_307);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_137));
  PyTuple_SET_ITEM(__pyx_k_tuple_307, 0, ((PyObject *)__pyx_kp_s_137));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_137));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_307));

  /* "pyfmi\fmi.pyx":5636
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_308 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_308)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_308);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_149));
  PyTuple_SET_ITEM(__pyx_k_tuple_308, 0, ((PyObject *)__pyx_kp_s_149));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_149));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_308));

  /* "pyfmi\fmi.pyx":5671
 * 
 *         if status != 0:
 *             raise FMUException('Failed to update the events.')             # <<<<<<<<<<<<<<
 * 
 *     def get_tolerances(self):
 */
  __pyx_k_tuple_310 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_310)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_310);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_154));
  PyTuple_SET_ITEM(__pyx_k_tuple_310, 0, ((PyObject *)__pyx_kp_s_154));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_154));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_310));

  /* "pyfmi\fmi.pyx":5710
 * 
 *         if status != 0:
 *             raise FMUException('An error occured when updating FMU after global event iteration has converged ')             # <<<<<<<<<<<<<<
 * 
 *         return status
 */
  __pyx_k_tuple_313 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_313)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_313);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_312));
  PyTuple_SET_ITEM(__pyx_k_tuple_313, 0, ((PyObject *)__pyx_kp_s_312));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_312));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_313));

  /* "pyfmi\fmi.pyx":5733
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         if callEventUpdate == 1:
 */
  __pyx_k_tuple_314 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_314)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_314);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_159));
  PyTuple_SET_ITEM(__pyx_k_tuple_314, 0, ((PyObject *)__pyx_kp_s_159));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_159));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_314));

  /* "pyfmi\fmi.pyx":5754
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_315 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_315)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_315);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_139));
  PyTuple_SET_ITEM(__pyx_k_tuple_315, 0, ((PyObject *)__pyx_kp_s_139));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_139));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_315));

  /* "pyfmi\fmi.pyx":5771
 * 
 *         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_316 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_316)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_316);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_141));
  PyTuple_SET_ITEM(__pyx_k_tuple_316, 0, ((PyObject *)__pyx_kp_s_141));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_141));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_316));

  /* "pyfmi\fmi.pyx":5779
 * 
 *         if status >= 3:
 *             raise FMUException('Failed to set the new continuous states.')             # <<<<<<<<<<<<<<
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,
 */
  __pyx_k_tuple_317 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_317)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_317);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_143));
  PyTuple_SET_ITEM(__pyx_k_tuple_317, 0, ((PyObject *)__pyx_kp_s_143));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_143));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_317));

  /* "pyfmi\fmi.pyx":5802
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_318 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_318)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_318);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_145));
  PyTuple_SET_ITEM(__pyx_k_tuple_318, 0, ((PyObject *)__pyx_kp_s_145));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_145));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_318));

  /* "pyfmi\fmi.pyx":5833
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the derivative values.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_319 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_319)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_319);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_147));
  PyTuple_SET_ITEM(__pyx_k_tuple_319, 0, ((PyObject *)__pyx_kp_s_147));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_147));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_319));

  /* "pyfmi\fmi.pyx":5962
 * 
 *     # 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_326 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_326)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_326);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
  PyTuple_SET_ITEM(__pyx_k_tuple_326, 0, ((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_326));

  /* "pyfmi\fmi.pyx":5963
 *     # 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_327 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_327)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_327);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
  PyTuple_SET_ITEM(__pyx_k_tuple_327, 0, ((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_327));

  /* "pyfmi\fmi.pyx":5995
 *             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:
 *         #Delete the context
 */
  __pyx_k_tuple_328 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_328)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_328);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_23));
  PyTuple_SET_ITEM(__pyx_k_tuple_328, 0, ((PyObject *)__pyx_kp_s_23));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_328));

  /* "pyfmi\fmi.pyx":6001
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Parse the XML
 */
  __pyx_k_tuple_330 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_330)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_330);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_329));
  PyTuple_SET_ITEM(__pyx_k_tuple_330, 0, ((PyObject *)__pyx_kp_s_329));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_329));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_330));

  /* "pyfmi\fmi.pyx":6010
 *             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.")             # <<<<<<<<<<<<<<
 *     allocated_xml = True
 * 
 */
  __pyx_k_tuple_331 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_331)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_331);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_28));
  PyTuple_SET_ITEM(__pyx_k_tuple_331, 0, ((PyObject *)__pyx_kp_s_28));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_331));

  /* "pyfmi\fmi.pyx":6028
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Delete the XML
 */
  __pyx_k_tuple_332 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_332)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_332);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_329));
  PyTuple_SET_ITEM(__pyx_k_tuple_332, 0, ((PyObject *)__pyx_kp_s_329));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_329));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_332));

  /* "pyfmi\fmi.pyx":6050
 *             if line == "":
 *                 break
 *             log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(log)):
 */
  __pyx_k_tuple_333 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_333)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_333);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_37));
  PyTuple_SET_ITEM(__pyx_k_tuple_333, 0, ((PyObject *)__pyx_kp_s_37));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_333));

  /* "pyfmi\fmi.pyx":6045
 * def _handle_load_fmu_exception(fmu, log_file):
 *     log = []
 *     with open(log_file,'r') as file:             # <<<<<<<<<<<<<<
 *         while True:
 *             line = file.readline()
 */
  __pyx_k_tuple_334 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_334)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_334);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_334, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_334, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_334, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_334));

  /* "pyfmi\fmi.pyx":6117
 *     # 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_336 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_336)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_336);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
  PyTuple_SET_ITEM(__pyx_k_tuple_336, 0, ((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_336));

  /* "pyfmi\fmi.pyx":6118
 *     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_337 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_337)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_337);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
  PyTuple_SET_ITEM(__pyx_k_tuple_337, 0, ((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_337));

  /* "pyfmi\fmi.pyx":6122
 *     #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_338 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_338)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_338);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_178));
  PyTuple_SET_ITEM(__pyx_k_tuple_338, 0, ((PyObject *)__pyx_kp_s_178));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_178));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_338));

  /* "pyfmi\fmi.pyx":6150
 *             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_340 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_340)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_340);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
  PyTuple_SET_ITEM(__pyx_k_tuple_340, 0, ((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_340));

  /* "pyfmi\fmi.pyx":6189
 *         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_342 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_342)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_342);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_23));
  PyTuple_SET_ITEM(__pyx_k_tuple_342, 0, ((PyObject *)__pyx_kp_s_23));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_342));

  /* "pyfmi\fmi.pyx":6201
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is unsupported. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_345 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_345)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_345);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_344));
  PyTuple_SET_ITEM(__pyx_k_tuple_345, 0, ((PyObject *)__pyx_kp_s_344));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_344));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_345));

  /* "pyfmi\fmi.pyx":6219
 *             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_346 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_346)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_346);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_185));
  PyTuple_SET_ITEM(__pyx_k_tuple_346, 0, ((PyObject *)__pyx_kp_s_185));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_185));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_346));

  /* "pyfmi\fmi.pyx":6233
 *             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_348 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_348)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_348);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_347));
  PyTuple_SET_ITEM(__pyx_k_tuple_348, 0, ((PyObject *)__pyx_kp_s_347));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_347));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_348));

  /* "pyfmi\fmi.pyx":6255
 *             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_351 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_351)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_351);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_185));
  PyTuple_SET_ITEM(__pyx_k_tuple_351, 0, ((PyObject *)__pyx_kp_s_185));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_185));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_351));

  /* "pyfmi\fmi.pyx":6270
 *             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_352 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_352)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_352);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_188));
  PyTuple_SET_ITEM(__pyx_k_tuple_352, 0, ((PyObject *)__pyx_kp_s_188));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_188));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_352));

  /* "pyfmi\fmi.pyx":6305
 *         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_355 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_355)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_355);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_354));
  PyTuple_SET_ITEM(__pyx_k_tuple_355, 0, ((PyObject *)__pyx_kp_s_354));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_354));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_355));

  /* "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")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_k_tuple_357 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_357)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_357);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_356));
  PyTuple_SET_ITEM(__pyx_k_tuple_357, 0, ((PyObject *)__pyx_kp_u_356));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_356));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_357));

  /* "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")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_k_tuple_359 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_359)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_359);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_358));
  PyTuple_SET_ITEM(__pyx_k_tuple_359, 0, ((PyObject *)__pyx_kp_u_358));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_358));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_359));

  /* "numpy.pxd":256
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' 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_361 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_361)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_361);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_360));
  PyTuple_SET_ITEM(__pyx_k_tuple_361, 0, ((PyObject *)__pyx_kp_u_360));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_360));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_361));

  /* "numpy.pxd":798
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 */
  __pyx_k_tuple_364 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_364)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_364);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_363));
  PyTuple_SET_ITEM(__pyx_k_tuple_364, 0, ((PyObject *)__pyx_kp_u_363));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_363));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_364));

  /* "numpy.pxd":802
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' 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_365 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_365)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_365);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_360));
  PyTuple_SET_ITEM(__pyx_k_tuple_365, 0, ((PyObject *)__pyx_kp_u_360));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_360));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_365));

  /* "numpy.pxd":822
 *             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_367 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_367)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_367);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_366));
  PyTuple_SET_ITEM(__pyx_k_tuple_367, 0, ((PyObject *)__pyx_kp_u_366));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_366));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_367));

  /* "pyfmi\fmi.pyx":5938
 *         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_385 = PyTuple_New(16); if (unlikely(!__pyx_k_tuple_385)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_385);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 0, ((PyObject *)__pyx_n_s__fmu));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__path));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 1, ((PyObject *)__pyx_n_s__path));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__path));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__enable_logging));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 2, ((PyObject *)__pyx_n_s__enable_logging));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__enable_logging));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__log_file_name));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 3, ((PyObject *)__pyx_n_s__log_file_name));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__log_file_name));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__callBackFunctions));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 4, ((PyObject *)__pyx_n_s__callBackFunctions));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__callBackFunctions));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__callbacks));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 5, ((PyObject *)__pyx_n_s__callbacks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__callbacks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__context));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 6, ((PyObject *)__pyx_n_s__context));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__context));
  __Pyx_INCREF(((PyObject *)__pyx_n_s___fmu));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 7, ((PyObject *)__pyx_n_s___fmu));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s___fmu));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__last_error));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 8, ((PyObject *)__pyx_n_s__last_error));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__last_error));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__allocated_context));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 9, ((PyObject *)__pyx_n_s__allocated_context));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__allocated_context));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__allocated_xml));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 10, ((PyObject *)__pyx_n_s__allocated_xml));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__allocated_xml));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu_temp_dir));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 11, ((PyObject *)__pyx_n_s__fmu_temp_dir));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu_temp_dir));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu_full_path));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 12, ((PyObject *)__pyx_n_s__fmu_full_path));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu_full_path));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__version));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 13, ((PyObject *)__pyx_n_s__version));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__version));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu_kind));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 14, ((PyObject *)__pyx_n_s__fmu_kind));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu_kind));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__model));
  PyTuple_SET_ITEM(__pyx_k_tuple_385, 15, ((PyObject *)__pyx_n_s__model));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__model));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_385));
  __pyx_k_codeobj_386 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_387, __pyx_n_s__load_fmu_deprecated, 5938, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_386)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":6043
 *     return model
 * 
 * def _handle_load_fmu_exception(fmu, log_file):             # <<<<<<<<<<<<<<
 *     log = []
 *     with open(log_file,'r') as file:
 */
  __pyx_k_tuple_388 = PyTuple_New(6); if (unlikely(!__pyx_k_tuple_388)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_388);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu));
  PyTuple_SET_ITEM(__pyx_k_tuple_388, 0, ((PyObject *)__pyx_n_s__fmu));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__log_file));
  PyTuple_SET_ITEM(__pyx_k_tuple_388, 1, ((PyObject *)__pyx_n_s__log_file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__log_file));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__log));
  PyTuple_SET_ITEM(__pyx_k_tuple_388, 2, ((PyObject *)__pyx_n_s__log));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__log));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  PyTuple_SET_ITEM(__pyx_k_tuple_388, 3, ((PyObject *)__pyx_n_s__file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__line));
  PyTuple_SET_ITEM(__pyx_k_tuple_388, 4, ((PyObject *)__pyx_n_s__line));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__line));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_388, 5, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_388));
  __pyx_k_codeobj_389 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_388, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_387, __pyx_n_s_341, 6043, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_389)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":6055
 *         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_391 = PyTuple_New(22); if (unlikely(!__pyx_k_tuple_391)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_391);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 0, ((PyObject *)__pyx_n_s__fmu));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__path));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 1, ((PyObject *)__pyx_n_s__path));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__path));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__enable_logging));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 2, ((PyObject *)__pyx_n_s__enable_logging));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__enable_logging));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__log_file_name));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 3, ((PyObject *)__pyx_n_s__log_file_name));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__log_file_name));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__kind));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 4, ((PyObject *)__pyx_n_s__kind));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__kind));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__log_level));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 5, ((PyObject *)__pyx_n_s__log_level));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__log_level));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__context));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 6, ((PyObject *)__pyx_n_s__context));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__context));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__callbacks));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 7, ((PyObject *)__pyx_n_s__callbacks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__callbacks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__callBackFunctions_1));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 8, ((PyObject *)__pyx_n_s__callBackFunctions_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__callBackFunctions_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__callBackFunctions_2));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 9, ((PyObject *)__pyx_n_s__callBackFunctions_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__callBackFunctions_2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__last_error));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 10, ((PyObject *)__pyx_n_s__last_error));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__last_error));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__version));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 11, ((PyObject *)__pyx_n_s__version));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__version));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu_1));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 12, ((PyObject *)__pyx_n_s__fmu_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu_2));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 13, ((PyObject *)__pyx_n_s__fmu_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu_2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu_1_kind));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 14, ((PyObject *)__pyx_n_s__fmu_1_kind));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu_1_kind));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu_2_kind));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 15, ((PyObject *)__pyx_n_s__fmu_2_kind));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu_2_kind));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__log_file_c));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 16, ((PyObject *)__pyx_n_s__log_file_c));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__log_file_c));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu_temp_dir));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 17, ((PyObject *)__pyx_n_s__fmu_temp_dir));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu_temp_dir));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__model));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 18, ((PyObject *)__pyx_n_s__model));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__model));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__log_file));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 19, ((PyObject *)__pyx_n_s__log_file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__log_file));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu_full_path));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 20, ((PyObject *)__pyx_n_s__fmu_full_path));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu_full_path));
  __Pyx_INCREF(((PyObject *)__pyx_n_s_390));
  PyTuple_SET_ITEM(__pyx_k_tuple_391, 21, ((PyObject *)__pyx_n_s_390));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_390));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_391));
  __pyx_k_codeobj_392 = (PyObject*)__Pyx_PyCode_New(6, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_387, __pyx_n_s__load_fmu, 6055, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_392)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6055; __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;
  PyObject *__pyx_t_3 = 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_368), 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  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 = 140; __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 = 140; __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 = 283; __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 = 283; __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 = 382; __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 = 382; __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 = 481; __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 = 481; __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 *, char *, 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 *, char *, 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 *, char *, 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 *, char *, 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 *, char *, 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 *, char *, 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 *, char *, 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 *, char *, 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 *, char *, 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 = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelBase, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __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__;
    }
  }
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelBase.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __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 = 490; __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 = 1846; __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 = 1846; __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 = 1846; __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 = 2272; __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 = 2272; __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 = 2272; __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 *, char *, 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 *, char *, 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 *, char *, 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 *, char *, 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 *, char *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_causality;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_start = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, char *, 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 *, char *, 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 *, char *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_min;
  __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_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 = 2835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelBase2, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; __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__;
    }
  }
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelBase2.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; __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 = 2835; __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 = 4740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelCS2, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4740; __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__;
    }
  }
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelCS2.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelCS2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4740; __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 = 4740; __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.completed_event_iteration = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelME2_completed_event_iteration;
  __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 = 5352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelME2, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5352; __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__;
    }
  }
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelME2.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelME2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5352; __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 = 5352; __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 = 5933; __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 = 5933; __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 = 5933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModel = &__pyx_type_5pyfmi_3fmi_FMUModel;
  /*--- Type import code ---*/
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __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 = 164; __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 = 168; __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 = 177; __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 = 860; __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 numpy as N
 */
  __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 numpy as N             # <<<<<<<<<<<<<<
 * cimport numpy as N
 * 
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -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);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__N, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":30
 * cimport numpy as N
 * 
 * N.import_array()             # <<<<<<<<<<<<<<
 * 
 * cimport fmil_import as FMIL
 */
  import_array();

  /* "pyfmi\fmi.pyx":34
 * 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_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__create_temp_dir));
  PyList_SET_ITEM(__pyx_t_2, 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_2, 1, ((PyObject *)__pyx_n_s__delete_temp_dir));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delete_temp_dir));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_369), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __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_dir);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__create_temp_dir);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__create_temp_dir, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __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_dir);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__delete_temp_dir);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__delete_temp_dir, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __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":35
 * 
 * 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_file));
  PyList_SET_ITEM(__pyx_t_1, 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_1, 1, ((PyObject *)__pyx_n_s__delete_temp_file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delete_temp_file));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_369), ((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_file);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__create_temp_file);
    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_file, __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_file);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__delete_temp_file);
    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_file, __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":38
 * #from pyfmi.common.core cimport BaseModel
 * 
 * int   = N.int32             # <<<<<<<<<<<<<<
 * N.int = N.int32
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __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 = 38; __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__int, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":39
 * 
 * int   = N.int32
 * N.int = N.int32             # <<<<<<<<<<<<<<
 * 
 * """Basic flags related to FMI"""
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); 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_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int32); 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(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); 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_t_1, __pyx_n_s__int, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __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":43
 * """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_370)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":44
 * 
 * FMI_TRUE  = '\x01'
 * FMI_FALSE = '\x00'             # <<<<<<<<<<<<<<
 * 
 * # Status
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_FALSE, ((PyObject *)__pyx_kp_s_371)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":47
 * 
 * # Status
 * FMI_OK      = FMIL.fmi1_status_ok             # <<<<<<<<<<<<<<
 * FMI_WARNING = FMIL.fmi1_status_warning
 * FMI_DISCARD = FMIL.fmi1_status_discard
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_status_ok); 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);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_OK, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":48
 * # 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_1 = PyInt_FromLong(fmi1_status_warning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_WARNING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":49
 * 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_1 = PyInt_FromLong(fmi1_status_discard); 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__FMI_DISCARD, __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":50
 * 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_1 = PyInt_FromLong(fmi1_status_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_ERROR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":51
 * 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_1 = PyInt_FromLong(fmi1_status_fatal); 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__FMI_FATAL, __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;

  /* "pyfmi\fmi.pyx":52
 * FMI_ERROR   = FMIL.fmi1_status_error
 * FMI_FATAL   = FMIL.fmi1_status_fatal
 * FMI_PENDING = FMIL.fmi1_status_pending             # <<<<<<<<<<<<<<
 * 
 * # Types
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_status_pending); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_PENDING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":55
 * 
 * # Types
 * FMI_REAL        = FMIL.fmi1_base_type_real             # <<<<<<<<<<<<<<
 * FMI_INTEGER     = FMIL.fmi1_base_type_int
 * FMI_BOOLEAN     = FMIL.fmi1_base_type_bool
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_base_type_real); 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);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_REAL, __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;

  /* "pyfmi\fmi.pyx":56
 * # 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_1 = PyInt_FromLong(fmi1_base_type_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_INTEGER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":57
 * 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_1 = PyInt_FromLong(fmi1_base_type_bool); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_BOOLEAN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":58
 * 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_1 = PyInt_FromLong(fmi1_base_type_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_STRING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":59
 * 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_1 = PyInt_FromLong(fmi1_base_type_enum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_ENUMERATION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":61
 * 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_1 = PyInt_FromLong(fmi2_base_type_real); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_REAL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":62
 * 
 * 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_1 = PyInt_FromLong(fmi2_base_type_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_INTEGER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":63
 * 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_1 = PyInt_FromLong(fmi2_base_type_bool); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_BOOLEAN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":64
 * 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_1 = PyInt_FromLong(fmi2_base_type_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_STRING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":65
 * 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_1 = PyInt_FromLong(fmi2_base_type_enum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_ENUMERATION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":68
 * 
 * # 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_1 = PyInt_FromLong(fmi1_variable_is_not_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_NO_ALIAS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":69
 * # 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_1 = PyInt_FromLong(fmi1_variable_is_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_ALIAS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":70
 * 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_1 = PyInt_FromLong(fmi1_variable_is_negated_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_NEGATED_ALIAS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":73
 * 
 * # Variability
 * FMI_CONTINUOUS = FMIL.fmi1_variability_enu_continuous             # <<<<<<<<<<<<<<
 * FMI_CONSTANT   = FMIL.fmi1_variability_enu_constant
 * FMI_PARAMETER  = FMIL.fmi1_variability_enu_parameter
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_variability_enu_continuous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_CONTINUOUS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":74
 * # 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_1 = PyInt_FromLong(fmi1_variability_enu_constant); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_CONSTANT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":75
 * 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_1 = PyInt_FromLong(fmi1_variability_enu_parameter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_PARAMETER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":76
 * 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_1 = PyInt_FromLong(fmi1_variability_enu_discrete); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_DISCRETE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":78
 * 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_1 = PyInt_FromLong(fmi2_variability_enu_constant); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_CONSTANT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":79
 * 
 * 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_1 = PyInt_FromLong(fmi2_variability_enu_fixed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_FIXED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":80
 * 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_1 = PyInt_FromLong(fmi2_variability_enu_tunable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_TUNABLE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":81
 * 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_1 = PyInt_FromLong(fmi2_variability_enu_discrete); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_DISCRETE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":82
 * 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_1 = PyInt_FromLong(fmi2_variability_enu_continuous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_CONTINUOUS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":83
 * FMI2_DISCRETE   = FMIL.fmi2_variability_enu_discrete
 * FMI2_CONTINUOUS = FMIL.fmi2_variability_enu_continuous
 * FMI2_UNKNOWN    = FMIL.fmi2_variability_enu_unknown             # <<<<<<<<<<<<<<
 * 
 * # Causality
 */
  __pyx_t_1 = PyInt_FromLong(fmi2_variability_enu_unknown); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_UNKNOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":86
 * 
 * # Causality
 * FMI_INPUT    = FMIL.fmi1_causality_enu_input             # <<<<<<<<<<<<<<
 * FMI_OUTPUT   = FMIL.fmi1_causality_enu_output
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_causality_enu_input); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_INPUT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":87
 * # 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_1 = PyInt_FromLong(fmi1_causality_enu_output); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_OUTPUT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":88
 * 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_1 = PyInt_FromLong(fmi1_causality_enu_internal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_INTERNAL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":89
 * FMI_OUTPUT   = FMIL.fmi1_causality_enu_output
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal
 * FMI_NONE     = FMIL.fmi1_causality_enu_none             # <<<<<<<<<<<<<<
 * 
 * # FMI types
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_causality_enu_none); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_NONE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":92
 * 
 * # FMI types
 * FMI_ME                 = FMIL.fmi1_fmu_kind_enu_me             # <<<<<<<<<<<<<<
 * FMI_CS_STANDALONE      = FMIL.fmi1_fmu_kind_enu_cs_standalone
 * FMI_MIME_CS_STANDALONE = "application/x-fmu-sharedlibrary"
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_fmu_kind_enu_me); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_ME, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":93
 * # FMI types
 * FMI_ME                 = FMIL.fmi1_fmu_kind_enu_me
 * FMI_CS_STANDALONE      = FMIL.fmi1_fmu_kind_enu_cs_standalone             # <<<<<<<<<<<<<<
 * FMI_MIME_CS_STANDALONE = "application/x-fmu-sharedlibrary"
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_fmu_kind_enu_cs_standalone); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_CS_STANDALONE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":94
 * FMI_ME                 = FMIL.fmi1_fmu_kind_enu_me
 * FMI_CS_STANDALONE      = FMIL.fmi1_fmu_kind_enu_cs_standalone
 * FMI_MIME_CS_STANDALONE = "application/x-fmu-sharedlibrary"             # <<<<<<<<<<<<<<
 * 
 * FMI_REGISTER_GLOBALLY = 1
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_121, ((PyObject *)__pyx_kp_s_372)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

  /* "pyfmi\fmi.pyx":97
 * 
 * FMI_REGISTER_GLOBALLY = 1
 * FMI_DEFAULT_LOG_LEVEL = FMIL.jm_log_level_error             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyInt_FromLong(jm_log_level_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_373, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

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

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

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

  /* "pyfmi\fmi.pyx":273
 *         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 = 273; __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 = 273; __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_374)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1), __pyx_n_s__FMUException, __pyx_n_s_375); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMUException, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":279
 *     pass
 * 
 * class PyEventInfo():             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1), __pyx_n_s__PyEventInfo, __pyx_n_s_375); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PyEventInfo, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":289
 *     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 = 289; __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":290
 *                        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 = 290; __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":309
 *         """
 *         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 = 309; __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 = 309; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 309; __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":320
 *         """
 *         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_376); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __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 = 320; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 320; __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":332
 *         """
 *         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 = 332; __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 = 332; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 332; __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":344
 *         """
 *         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 = 344; __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 = 344; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 344; __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":356
 *         """
 *         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 = 356; __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 = 356; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 356; __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":368
 *         """
 *         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 = 368; __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 = 368; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 368; __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":380
 *         """
 *         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 = 380; __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 = 380; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 380; __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":387
 *     """
 *     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 = 387; __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":388
 *     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_causality_enu_unknown); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __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":389
 *                        variability = FMIL.fmi2_variability_enu_unknown,
 *                        causality   = FMIL.fmi2_causality_enu_unknown,
 *                        alias       = FMIL.fmi2_variable_is_not_alias):             # <<<<<<<<<<<<<<
 * 
 *         self._name            = name
 */
  __pyx_t_1 = PyInt_FromLong(fmi2_variable_is_not_alias); 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_k_12 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":408
 *         """
 *         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 = 408; __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 = 408; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 408; __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":419
 *         """
 *         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_376); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __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 = 419; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 419; __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":431
 *         """
 *         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 = 431; __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 = 431; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 431; __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":443
 *         """
 *         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 = 443; __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 = 443; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 443; __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":455
 *         """
 *         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 = 455; __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 = 455; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 455; __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":467
 *         """
 *         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 = 467; __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 = 467; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 467; __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":479
 *         """
 *         return self._alias
 *     alias = property(_get_alias)             # <<<<<<<<<<<<<<
 * 
 * cdef class FMUState2:
 */
  __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 = 479; __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 = 479; __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_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 479; __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":494
 *     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_373); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __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":700
 *         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 = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelBase, __pyx_n_s___get_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__fget), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelBase);

  /* "pyfmi\fmi.pyx":1431
 * 
 * 
 *     def get_model_variables(self,type=None, include_alias=True,             # <<<<<<<<<<<<<<
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False,
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(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_k_84 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1433
 *     def get_model_variables(self,type=None, include_alias=True,
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False,             # <<<<<<<<<<<<<<
 *                             filter=None):
 *         """
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k_85 = __pyx_t_3;
  __Pyx_GIVEREF(__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 = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k_86 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1850
 *     #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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_373); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k_90 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1865
 *         self.__t = t
 * 
 *     time = property(_get_time,_set_time, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the current time of the simulation. Calls the
 */
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1, __pyx_n_s___get_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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 = 1865; __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 = 1865; __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __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_377)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelCS1);

  /* "pyfmi\fmi.pyx":1897
 *             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_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k_93 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":2010
 *         return FMIL.fmi1_import_get_types_platform(self._fmu)
 * 
 *     types_platform = property(fget=_get_types_platform)             # <<<<<<<<<<<<<<
 * 
 *     def set_input_derivatives(self, variables, values, orders):
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __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 = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__fget), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2010; __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_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 2010; __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":2070
 *                  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 = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_k_108 = ((PyObject *)__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":2277
 *     """
 * 
 *     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_373); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_132 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2302
 *         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 = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_378); 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);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__fget), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); 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_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s_379, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME1);

  /* "pyfmi\fmi.pyx":2373
 *             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_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s___get_time); 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_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 = 2373; __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 = 2373; __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; __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_377)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); 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(((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_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME1);

  /* "pyfmi\fmi.pyx":2404
 *             raise FMUException('Failed to set the new continuous states.')
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,             # <<<<<<<<<<<<<<
 *         doc=
 *     """
 */
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_380); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_381); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2404; __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 = 2404; __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 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2404; __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_382)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME1);

  /* "pyfmi\fmi.pyx":2423
 *         return ndx
 * 
 *     nominal_continuous_states = property(_get_nominal_continuous_states, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the nominal values of the continuous states. Calls
 */
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_383); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_384)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __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_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s_152, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __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":2506
 *         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 = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_153 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

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

  /* "pyfmi\fmi.pyx":2733
 *                  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 = 2733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_k_174 = ((PyObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2839
 *     FMI Model loaded from a dll.
 *     """
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = ""):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_175 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3422
 *             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 = 3422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_209 = ((PyObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

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

  /* "pyfmi\fmi.pyx":3712
 *     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 = 3712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_216 = __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 = 3712; __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":4745
 *     """
 * 
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = ""):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_255 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4804
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 * 
 *     def instantiate_slave(self, name = 'Slave', visible = False):             # <<<<<<<<<<<<<<
 *         """
 *         Instantiate the slave.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_260 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4833
 *             raise FMUException('Failed to instantiate the slave.')
 * 
 *     def initialize(self, tStart=0.0, tStop=1.0, StopTimeDefined=False, relTol=None):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the slave.
 */
  __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_263 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_264 = __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 = 4833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_265 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4919
 *         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 = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2, __pyx_n_s___set_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4919; __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 = 4919; __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_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_377)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4919; __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_3)); __pyx_t_3 = 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 = 4919; __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":4927
 * 
 * 
 *     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 = 4927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_270 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5266
 * 
 *     def simulate(self,
 *                  start_time=0.0,             # <<<<<<<<<<<<<<
 *                  final_time=1.0,
 *                  input=(),
 */
  __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5266; __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;

  /* "pyfmi\fmi.pyx":5267
 *     def simulate(self,
 *                  start_time=0.0,
 *                  final_time=1.0,             # <<<<<<<<<<<<<<
 *                  input=(),
 *                  algorithm='FMICSAlg',
 */
  __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5267; __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;

  /* "pyfmi\fmi.pyx":5270
 *                  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 = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_k_293 = ((PyObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5357
 *     """
 * 
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = ""):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5357; __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":5417
 * 
 * 
 *     def instantiate_model(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 = 5417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_298 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5448
 *             raise FMUException('Failed to instantiate the model.')
 * 
 *     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 = 5448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_301 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5567
 *         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 = 5567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2, __pyx_n_s___set_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5567; __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 = 5567; __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_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_377)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5567; __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_3)); __pyx_t_3 = 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 = 5567; __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":5640
 *         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 = 5640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_309 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5781
 *             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_380); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2, __pyx_n_s_381); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5781; __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 = 5781; __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_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_382)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5781; __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_3)); __pyx_t_3 = 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 = 5781; __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":5806
 *         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_383); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5806; __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 = 5806; __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5806; __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_384)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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_152, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5806; __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":5839
 * 
 *     def simulate(self,
 *                  start_time=0.0,             # <<<<<<<<<<<<<<
 *                  final_time=1.0,
 *                  input=(),
 */
  __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_320 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5840
 *     def simulate(self,
 *                  start_time=0.0,
 *                  final_time=1.0,             # <<<<<<<<<<<<<<
 *                  input=(),
 *                  algorithm='AssimuloFMIAlg',
 */
  __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_321 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":5938
 *         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 = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_325 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_1load_fmu_deprecated, NULL, __pyx_n_s_375); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5938; __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 = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6043
 *     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_3_handle_load_fmu_exception, NULL, __pyx_n_s_375); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_341, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6055
 *         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_373); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_335 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_5load_fmu, NULL, __pyx_n_s_375); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6055; __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 = 6055; __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":974
 *      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_3);
  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;
    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;
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
    if (unlikely(tstate->curexc_type))
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    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 (XDECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

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 %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_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_AS_STRING(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;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    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() {
    Py_ssize_t i;
    /*PyObject *d;*/
    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 = 0; i < PyList_GET_SIZE(names); i++) {
        PyObject* name = PyList_GET_ITEM(names, i);
        if (!PyDict_Contains(globals, name)) {
            PyObject* value = PyObject_GetAttr(__pyx_m, PyList_GET_ITEM(names, i));
            if (!value)
                goto bad;
            if (PyDict_SetItem(globals, name, value) < 0) {
                Py_DECREF(value);
                goto bad;
            }
        }
    }
    Py_DECREF(names);
    return globals;
    /*
    d = PyDictProxy_New(globals);
    Py_DECREF(globals);
    return d;
    */
bad:
    Py_XDECREF(names);
    Py_XDECREF(globals);
    return NULL;
}

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
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        Py_DECREF(value);
        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) {
    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)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        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;
        }
        if (!value) {
            value = PyObject_CallObject(type, NULL);
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    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;
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #else
        if (unlikely(!PyUnicode_Check(key)))
        #endif
            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;
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 'b': return "'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, 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, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'h': case 'i':
    case 'l': case 'q': 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;
      }
      __Pyx_BufFmt_RaiseExpected(ctx);
      return -1;
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %"PY_FORMAT_SIZE_T"d but %"PY_FORMAT_SIZE_T"d expected",
                   (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 (%"PY_FORMAT_SIZE_T"d byte%s) does not match size of '%s' (%"PY_FORMAT_SIZE_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 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_RaiseNoneIndexingError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %"PY_FORMAT_SIZE_T"d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    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, '.')) {
                /* try package relative import first */
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
        }
    }
    #else
    if (level>0) {
        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:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    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) {
    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);
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
    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);
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    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;
    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;
    /* Default 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 *modname) {
    PyObject *result;
    PyObject *metaclass;
    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
        return NULL;
    /* Python2 __metaclass__ */
    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;
}

#if 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) {
    PyObject* v;
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                return -1;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            return -1;
        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)
            return -1;
        PyFile_SoftSpace(f, 0);
    }
    return 0;
}
#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 PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            return -1;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        return -1;
    if (PyFile_WriteString("\n", f) < 0)
        return -1;
    return 0;
    /* the line below is just to avoid compiler
     * 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_New(1);
    if (unlikely(!arg_tuple))
        return -1;
    Py_INCREF(o);
    PyTuple_SET_ITEM(arg_tuple, 0, o);
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = PyObject_GetAttr(o, n);
    if (!r) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

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 {
        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;
        }
        return (fmi1_value_reference_t)-1;
    }
}

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 int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        if (PyBytes_GET_SIZE(s1) != PyBytes_GET_SIZE(s2)) {
            return (equals == Py_NE);
        } else if (PyBytes_GET_SIZE(s1) == 1) {
            if (equals == Py_EQ)
                return (PyBytes_AS_STRING(s1)[0] == PyBytes_AS_STRING(s2)[0]);
            else
                return (PyBytes_AS_STRING(s1)[0] != PyBytes_AS_STRING(s2)[0]);
        } else {
            int result = memcmp(PyBytes_AS_STRING(s1), PyBytes_AS_STRING(s2), (size_t)PyBytes_GET_SIZE(s1));
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyUnicode_CheckExact(s1) & PyUnicode_CheckExact(s2)) {
        #if CYTHON_PEP393_ENABLED
        if ((PyUnicode_READY(s1) < 0) || (PyUnicode_READY(s2) < 0))
            return -1;
        if (PyUnicode_GET_LENGTH(s1) != PyUnicode_GET_LENGTH(s2)) {
            return (equals == Py_NE);
        } else if (PyUnicode_GET_LENGTH(s1) == 1) {
            Py_UCS4 ch1 = PyUnicode_READ_CHAR(s1, 0);
            Py_UCS4 ch2 = PyUnicode_READ_CHAR(s2, 0);
            return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2);
        #else
        if (PyUnicode_GET_SIZE(s1) != PyUnicode_GET_SIZE(s2)) {
            return (equals == Py_NE);
        } else if (PyUnicode_GET_SIZE(s1) == 1) {
            Py_UNICODE ch1 = PyUnicode_AS_UNICODE(s1)[0];
            Py_UNICODE ch2 = PyUnicode_AS_UNICODE(s2)[0];
            return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2);
        #endif
        } else {
            int result = PyUnicode_Compare(s1, s2);
            if ((result == -1) && unlikely(PyErr_Occurred()))
                return -1;
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyUnicode_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyUnicode_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
}

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 {
        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;
        }
        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 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, int clineno,
                                  int lineno, const char *filename) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static CYTHON_INLINE 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 {
        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;
        }
        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 {
        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;
        }
        return (fmi2_integer_t)-1;
    }
}

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_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_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;
    }
    if (!strict && (size_t)((PyTypeObject *)result)->tp_basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #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)((PyTypeObject *)result)->tp_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

#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

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


/* Type Conversion Functions */

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