/* Generated by Cython 0.21.2 */

#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 0
#else
#include "pyconfig.h"
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 1
#else
#define CYTHON_USE_PYLONG_INTERNALS 0
#endif
#endif
#endif
#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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_21_2"
#include <stddef.h>
#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 && PY_VERSION_HEX < 0x02070600
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#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)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#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_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#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
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  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
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
   a quiet NaN. */
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#ifdef __cplusplus
template<typename T>
void __Pyx_call_destructor(T* x) {
    x->~T();
}
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

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

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_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 Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
    (sizeof(type) > sizeof(Py_ssize_t) &&               \
          likely(v < (type)PY_SSIZE_T_MAX ||            \
                 v == (type)PY_SSIZE_T_MAX)  &&         \
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
                                v == (type)PY_SSIZE_T_MIN)))  ||  \
    (sizeof(type) == sizeof(Py_ssize_t) &&              \
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#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);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */

static PyObject *__pyx_m;
static PyObject *__pyx_d;
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[] = {
  "pyfmi\\fmi.pyx",
  "pyfmi\\fmi.pxd",
  "__init__.pxd",
  "type.pxd",
};
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  struct __Pyx_StructField_* fields;
  size_t size;
  size_t arraysize[8];
  int ndim;
  char typegroup;
  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;


/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":723
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":724
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":725
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":726
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":730
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":731
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":732
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":733
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":737
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":738
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":747
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":748
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_long_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":749
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":751
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":752
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":753
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":755
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":756
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":758
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":759
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":760
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif

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


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

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":762
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":763
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":764
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":766
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;

/* "pyfmi\fmi.pxd":34
 * cimport fmil_import as FMIL
 * 
 * cdef class ModelBase:             # <<<<<<<<<<<<<<
 *     """
 *     Abstract Model class containing base functionality.
 */
struct __pyx_obj_5pyfmi_3fmi_ModelBase {
  PyObject_HEAD
};


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


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


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


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


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


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


/* "pyfmi\fmi.pxd":186
 *     cdef _add_scalar_variable(self, FMIL.fmi2_import_variable_t* variable)
 * 
 * cdef class FMUModelCS2(FMUModelBase2):             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_time(self)
 */
struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 __pyx_base;
};


/* "pyfmi\fmi.pxd":191
 *     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.pyx":6240
 * 
 * #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.pyx":539
 * 
 * 
 * cdef class FMUModelBase(ModelBase):             # <<<<<<<<<<<<<<
 *     """
 *     An FMI Model loaded from a DLL.
 */

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


/* "pyfmi\fmi.pyx":1942
 * 
 * 
 * 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":2386
 *         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":2950
 * 
 * 
 * cdef class FMUModelBase2(ModelBase):             # <<<<<<<<<<<<<<
 *     """
 *     FMI Model loaded from a dll.
 */

struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 {
  PyObject *(*_logger)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, jm_string, int, jm_string);
  fmi2_value_reference_t (*get_variable_valueref)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  fmi2_base_type_enu_t (*get_variable_data_type)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_description)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  fmi2_variability_enu_t (*get_variable_variability)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  fmi2_causality_enu_t (*get_variable_causality)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_start)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_max)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_min)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  fmi2_initial_enu_t (*get_variable_initial)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*serialize_fmu_state)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*deserialize_fmu_state)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*serialized_fmu_state_size)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*_add_scalar_variables)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, fmi2_import_variable_list_t *);
  PyObject *(*_add_scalar_variable)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, fmi2_import_variable_t *);
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2;


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


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

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


/* "pyfmi\fmi.pyx":6240
 * 
 * #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;
#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);
  #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
#define __Pyx_XDECREF_SET(r, v) do {                            \
        PyObject *tmp = (PyObject *) r;                         \
        r = v; __Pyx_XDECREF(tmp);                              \
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {                             \
        PyObject *tmp = (PyObject *) r;                         \
        r = v; __Pyx_DECREF(tmp);                               \
    } while (0)
#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)

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);

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

#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);

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

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

static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
    const char* function_name);

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

static PyObject* __Pyx_Globals(void);

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

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

#include <string.h>

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

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

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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

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

static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
    __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);

static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d);

#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

static void __Pyx_RaiseBufferFallbackError(void);

static void __Pyx_RaiseBufferIndexError(int axis);

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

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) : \
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);

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

static int __Pyx_SetVtable(PyObject *dict, void *vtable);

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);

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

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

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 CYTHON_INLINE fmi1_value_reference_t __Pyx_PyInt_As_fmi1_value_reference_t(PyObject *);

static CYTHON_INLINE fmi1_integer_t __Pyx_PyInt_As_fmi1_integer_t(PyObject *);

static CYTHON_INLINE fmi2_integer_t __Pyx_PyInt_As_fmi2_integer_t(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

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

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

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_fmi1_value_reference_t(fmi1_value_reference_t value);

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_size_t(size_t value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_fmi1_boolean_t(fmi1_boolean_t value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_fmi1_integer_t(fmi1_integer_t value);

static CYTHON_INLINE fmi2_boolean_t __Pyx_PyInt_As_fmi2_boolean_t(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_fmi2_boolean_t(fmi2_boolean_t value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_fmi2_integer_t(fmi2_integer_t value);

#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(__clang__)) && 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 long __Pyx_PyInt_As_long(PyObject *);

static int __Pyx_check_binary_version(void);

#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

static PyObject *__Pyx_ImportModule(const char *name);

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

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); /* 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); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static enum fmi1_base_type_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static fmi1_value_reference_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static enum fmi1_variability_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static enum fmi1_causality_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelCS1__get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, int __pyx_skip_dispatch); /* 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); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME1__get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, int __pyx_skip_dispatch); /* 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); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME1_get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
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); /* proto*/
static fmi2_value_reference_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static fmi2_base_type_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static fmi2_variability_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static fmi2_initial_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_initial(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static fmi2_causality_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch); /* 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); /* 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); /* 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); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2__add_scalar_variables(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, fmi2_import_variable_list_t *__pyx_v_variable_list); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2__add_scalar_variable(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, fmi2_import_variable_t *__pyx_v_variable); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelCS2__get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, int __pyx_skip_dispatch); /* 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); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME2__get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, int __pyx_skip_dispatch); /* 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); /* proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME2_get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/

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

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

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

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

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

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

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

/* Module declarations from 'numpy' */

/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/

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

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

/* Implementation of 'pyfmi.fmi' */
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_pf_5pyfmi_3fmi_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_2decode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_4encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_6decode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_set(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_2get(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_4_exec_algorithm(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_6_exec_simulate_algorithm(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_module, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_8_default_options(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_algorithm); /* proto */
static int __pyx_pf_5pyfmi_3fmi_14ScalarVariable___init__(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value_reference, PyObject *__pyx_v_type, PyObject *__pyx_v_description, PyObject *__pyx_v_variability, PyObject *__pyx_v_causality, PyObject *__pyx_v_alias); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_2_get_name(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_4_get_value_reference(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_6_get_type(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_8_get_description(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_10_get_variability(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_12_get_causality(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_14_get_alias(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_15ScalarVariable2___init__(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value_reference, PyObject *__pyx_v_type, PyObject *__pyx_v_description, PyObject *__pyx_v_variability, PyObject *__pyx_v_causality, PyObject *__pyx_v_alias, PyObject *__pyx_v_initial); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_2_get_name(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_4_get_value_reference(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_6_get_type(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_8_get_description(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_10_get_variability(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_12_get_causality(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_14_get_alias(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_16_get_initial(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_9FMUState2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUState2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_2append_log_message(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_log_level, PyObject *__pyx_v_message); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_4get_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_6_internal_set_fmu_null(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8print_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_convert_filter(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_expression); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_get_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_14get_ode_sizes(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_16get_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_18set_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_20get_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_22set_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24get_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_26set_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_28get_string(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_30set_string(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref, CYTHON_UNUSED PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_32set_debug_logging(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_34set_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, jm_log_level_enu_t __pyx_v_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_36set_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, jm_log_level_enu_t __pyx_v_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_38_set(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_40_get(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_42get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_44get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_46get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_variable_nominal(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variablename, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_50get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_56get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_58get_model_variables(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_include_alias, PyObject *__pyx_v_causality, PyObject *__pyx_v_variability, PyObject *__pyx_v_only_start, PyObject *__pyx_v_only_fixed, PyObject *__pyx_v_filter); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_60get_model_time_varying_value_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_filter); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_62get_variable_alias_base(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_64get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_66get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_68get_variable_by_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, fmi1_value_reference_t __pyx_v_valueref, PyObject *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_70get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_72get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_74get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_76get_author(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_78get_default_experiment_start_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_80get_default_experiment_stop_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_82get_default_experiment_tolerance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_84get_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_86get_generation_tool(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_88get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_11FMUModelCS1___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_2_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_4_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_t); /* proto */
static void __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_6__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_8do_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_current_t, fmi1_real_t __pyx_v_step_size, PyObject *__pyx_v_new_step); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_10cancel_step(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_variables, fmi1_integer_t __pyx_v_order); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_14_get_types_platform(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_16get_real_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_18set_input_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_values, PyObject *__pyx_v_orders); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_20simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_22simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_24initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_tStart, PyObject *__pyx_v_tStop, PyObject *__pyx_v_StopTimeDefined); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_26reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_28instantiate_slave(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_logging); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_30get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_11FMUModelME1___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_2_get_model_types_platform(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_4reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static void __pyx_pf_5pyfmi_3fmi_11FMUModelME1_6__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_8_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_10_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, fmi1_real_t __pyx_v_t); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_12_get_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_14_set_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_16_get_nominal_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_18get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_20get_event_indicators(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_22get_tolerances(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_24event_update(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_intermediateResult); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_26get_event_info(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_28get_state_value_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_30completed_integrator_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_32initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_tolControlled, PyObject *__pyx_v_relativeTolerance); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_34instantiate_model(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_logging); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_36simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_38simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_40terminate(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_2get_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_4set_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_6get_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8set_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_10get_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12set_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_14get_string(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_16set_string(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref, CYTHON_UNUSED PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_18_set(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_20_get(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_22get_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24print_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_26instantiate(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_visible); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_28setup_experiment(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_tolerance_defined, PyObject *__pyx_v_tolerance, PyObject *__pyx_v_start_time, PyObject *__pyx_v_stop_time_defined, PyObject *__pyx_v_stop_time); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_30reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_32terminate(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_34initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_36set_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_38get_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_40set_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_42get_categories(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_44get_variable_nominal(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_46get_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_48get_variable_alias_base(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_50get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_52get_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_54get_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_56get_variable_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_58get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_60get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_62get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_64get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_66get_variable_initial(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_68get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_70get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_72get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_74get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_76get_fmu_state(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_78set_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_80free_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_82serialize_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_84deserialize_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_serialized_fmu); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_86serialized_fmu_state_size(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_88get_ode_sizes(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_90get_default_experiment_start_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_92get_default_experiment_stop_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_94get_default_experiment_tolerance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_96get_default_experiment_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_98_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_100get_derivatives_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_102get_state_space_representation(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_D); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_104get_states_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_106get_input_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_108get_output_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_110get_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_112get_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_114get_model_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_116get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_118get_author(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_120get_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_122get_copyright(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_124get_license(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_126get_generation_tool(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_128get_generation_date_and_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_130get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_132get_variable_naming_convention(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_134get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_136get_model_types_platform(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_11FMUModelCS2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static void __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_2__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_4_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_6_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, fmi2_real_t __pyx_v_t); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_8do_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, fmi2_real_t __pyx_v_current_t, fmi2_real_t __pyx_v_step_size, PyObject *__pyx_v_new_step); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_10cancel_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_12set_input_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_values, fmi2_integer_t __pyx_v_order); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_14get_output_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_variables, fmi2_integer_t __pyx_v_order); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_16get_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_18get_real_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_20get_integer_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_22get_boolean_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_24get_string_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_26simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_28simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_30get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_32_provides_directional_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_11FMUModelME2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static void __pyx_pf_5pyfmi_3fmi_11FMUModelME2_2__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_4_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_6_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, fmi2_real_t __pyx_v_t); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_8get_event_info(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_10enter_event_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_12enter_continuous_time_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_14get_event_indicators(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_16event_update(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_intermediateResult); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_18get_tolerances(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_20completed_integrator_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_no_set_FMU_state_prior_to_current_point); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_22_get_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_24_set_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_26_get_nominal_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_28get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_30simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_32simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_34get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_36_provides_directional_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_8FMUModel___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModel *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_8load_fmu_deprecated(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_10_handle_load_fmu_exception(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_fmu, PyObject *__pyx_v_log_file); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12load_fmu(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_kind, PyObject *__pyx_v_log_level); /* proto */
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
static PyObject *__pyx_tp_new_5pyfmi_3fmi_ModelBase(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5pyfmi_3fmi_ScalarVariable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5pyfmi_3fmi_ScalarVariable2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUState2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelBase(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelCS1(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelME1(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelBase2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelCS2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelME2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static char __pyx_k_A[] = "A";
static char __pyx_k_B[] = "B";
static char __pyx_k_C[] = "C";
static char __pyx_k_D[] = "D";
static char __pyx_k_H[] = "H";
static char __pyx_k_I[] = "I";
static char __pyx_k_L[] = "L";
static char __pyx_k_N[] = "N";
static char __pyx_k_O[] = "O";
static char __pyx_k_Q[] = "Q";
static char __pyx_k_a[] = "a";
static char __pyx_k_b[] = "b";
static char __pyx_k_d[] = "d";
static char __pyx_k_f[] = "f";
static char __pyx_k_g[] = "g";
static char __pyx_k_h[] = "h";
static char __pyx_k_i[] = "i";
static char __pyx_k_l[] = "l";
static char __pyx_k_q[] = "q";
static char __pyx_k_r[] = "r";
static char __pyx_k_v[] = "v";
static char __pyx_k_w[] = "w";
static char __pyx_k_x[] = "x";
static char __pyx_k_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__2[] = "";
static char __pyx_k_os[] = "os";
static char __pyx_k_re[] = "re";
static char __pyx_k__10[] = ".";
static char __pyx_k__23[] = "\n";
static char __pyx_k_alg[] = "alg";
static char __pyx_k_doc[] = "__doc__";
static char __pyx_k_end[] = "end";
static char __pyx_k_fmu[] = "fmu";
static char __pyx_k_get[] = "_get";
static char __pyx_k_int[] = "int";
static char __pyx_k_log[] = "log";
static char __pyx_k_set[] = "_set";
static char __pyx_k_sys[] = "sys";
static char __pyx_k__207[] = "\001";
static char __pyx_k__208[] = "\000";
static char __pyx_k_auto[] = "auto";
static char __pyx_k_exit[] = "__exit__";
static char __pyx_k_fget[] = "fget";
static char __pyx_k_file[] = "file";
static char __pyx_k_flat[] = "flat";
static char __pyx_k_init[] = "__init__";
static char __pyx_k_join[] = "join";
static char __pyx_k_keys[] = "keys";
static char __pyx_k_kind[] = "kind";
static char __pyx_k_line[] = "line";
static char __pyx_k_main[] = "__main__";
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_test[] = "__test__";
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_doc_2[] = "doc";
static char __pyx_k_dtype[] = "dtype";
static char __pyx_k_empty[] = "empty";
static char __pyx_k_enter[] = "__enter__";
static char __pyx_k_float[] = "float";
static char __pyx_k_fmu_1[] = "fmu_1";
static char __pyx_k_fmu_2[] = ".fmu";
static char __pyx_k_fmu_3[] = "_fmu";
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_print[] = "print";
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_codecs[] = "codecs";
static char __pyx_k_decode[] = "decode";
static char __pyx_k_double[] = "double";
static char __pyx_k_encode[] = "encode";
static char __pyx_k_filter[] = "filter";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_isfile[] = "isfile";
static char __pyx_k_module[] = "module";
static char __pyx_k_orders[] = "orders";
static char __pyx_k_tStart[] = "tStart";
static char __pyx_k_uint32[] = "uint32";
static char __pyx_k_values[] = "values";
static char __pyx_k_xrange[] = "xrange";
static char __pyx_k_Default[] = "Default";
static char __pyx_k_abspath[] = "abspath";
static char __pyx_k_compile[] = "compile";
static char __pyx_k_context[] = "context";
static char __pyx_k_flatten[] = "flatten";
static char __pyx_k_fmu_2_2[] = "fmu_2";
static char __pyx_k_fnmatch[] = "fnmatch";
static char __pyx_k_get_log[] = "get_log";
static char __pyx_k_initial[] = "initial";
static char __pyx_k_log_txt[] = "_log.txt";
static char __pyx_k_logging[] = "logging";
static char __pyx_k_message[] = "message";
static char __pyx_k_options[] = "options";
static char __pyx_k_prepare[] = "__prepare__";
static char __pyx_k_unknown[] = "unknown";
static char __pyx_k_var_ref[] = "var_ref";
static char __pyx_k_version[] = "version";
static char __pyx_k_visible[] = "visible";
static char __pyx_k_warning[] = "warning";
static char __pyx_k_FMICSAlg[] = "FMICSAlg";
static char __pyx_k_FMI_NONE[] = "FMI_NONE";
static char __pyx_k_FMI_REAL[] = "FMI_REAL";
static char __pyx_k_FMI_TRUE[] = "FMI_TRUE";
static char __pyx_k_FMU_is_a[] = "FMU is a ";
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_name[] = "_get_name";
static char __pyx_k_get_real[] = "get_real";
static char __pyx_k_get_time[] = "_get_time";
static char __pyx_k_get_type[] = "_get_type";
static char __pyx_k_load_fmu[] = "load_fmu";
static char __pyx_k_log_file[] = "log_file";
static char __pyx_k_module_2[] = "__module__";
static char __pyx_k_new_step[] = "new_step";
static char __pyx_k_property[] = "property";
static char __pyx_k_qualname[] = "__qualname__";
static char __pyx_k_readline[] = "readline";
static char __pyx_k_set_real[] = "set_real";
static char __pyx_k_set_time[] = "_set_time";
static char __pyx_k_valueref[] = "valueref";
static char __pyx_k_Exception[] = "Exception";
static char __pyx_k_FMI2_REAL[] = "FMI2_REAL";
static char __pyx_k_FMI2_TRUE[] = "FMI2_TRUE";
static char __pyx_k_FMI_ALIAS[] = "FMI_ALIAS";
static char __pyx_k_FMI_ERROR[] = "FMI_ERROR";
static char __pyx_k_FMI_FALSE[] = "FMI_FALSE";
static char __pyx_k_FMI_FATAL[] = "FMI_FATAL";
static char __pyx_k_FMI_INPUT[] = "FMI_INPUT";
static char __pyx_k_algorithm[] = "algorithm";
static char __pyx_k_and_not_a[] = " and not a ";
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_get_alias[] = "_get_alias";
static char __pyx_k_log_level[] = "log_level";
static char __pyx_k_metaclass[] = "__metaclass__";
static char __pyx_k_pyfmi_fmi[] = "pyfmi.fmi";
static char __pyx_k_step_size[] = "step_size";
static char __pyx_k_stop_time[] = "stop_time";
static char __pyx_k_tolerance[] = "tolerance";
static char __pyx_k_translate[] = "translate";
static char __pyx_k_variables[] = "variables";
static char __pyx_k_FMI2_FALSE[] = "FMI2_FALSE";
static char __pyx_k_FMI2_FIXED[] = "FMI2_FIXED";
static char __pyx_k_FMI2_INPUT[] = "FMI2_INPUT";
static char __pyx_k_FMI_INPUTS[] = "FMI_INPUTS";
static char __pyx_k_FMI_OUTPUT[] = "FMI_OUTPUT";
static char __pyx_k_FMI_STATES[] = "FMI_STATES";
static char __pyx_k_FMI_STRING[] = "FMI_STRING";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_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_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_set_string[] = "set_string";
static char __pyx_k_start_time[] = "start_time";
static char __pyx_k_structured[] = "structured";
static char __pyx_k_FMI2_OUTPUT[] = "FMI2_OUTPUT";
static char __pyx_k_FMI2_STRING[] = "FMI2_STRING";
static char __pyx_k_FMI_BOOLEAN[] = "FMI_BOOLEAN";
static char __pyx_k_FMI_DISCARD[] = "FMI_DISCARD";
static char __pyx_k_FMI_INTEGER[] = "FMI_INTEGER";
static char __pyx_k_FMI_OUTPUTS[] = "FMI_OUTPUTS";
static char __pyx_k_FMI_PENDING[] = "FMI_PENDING";
static char __pyx_k_FMI_WARNING[] = "FMI_WARNING";
static char __pyx_k_OrderedDict[] = "OrderedDict";
static char __pyx_k_PyEventInfo[] = "PyEventInfo";
static char __pyx_k_collections[] = "collections";
static char __pyx_k_description[] = "description";
static char __pyx_k_get_boolean[] = "get_boolean";
static char __pyx_k_get_initial[] = "_get_initial";
static char __pyx_k_get_integer[] = "get_integer";
static char __pyx_k_get_version[] = "_get_version";
static char __pyx_k_instantiate[] = "instantiate";
static char __pyx_k_set_boolean[] = "set_boolean";
static char __pyx_k_set_integer[] = "set_integer";
static char __pyx_k_variability[] = "variability";
static char __pyx_k_FMI2_BOOLEAN[] = "FMI2_BOOLEAN";
static char __pyx_k_FMI2_INTEGER[] = "FMI2_INTEGER";
static char __pyx_k_FMI2_TUNABLE[] = "FMI2_TUNABLE";
static char __pyx_k_FMI2_UNKNOWN[] = "FMI2_UNKNOWN";
static char __pyx_k_FMI_CONSTANT[] = "FMI_CONSTANT";
static char __pyx_k_FMI_DISCRETE[] = "FMI_DISCRETE";
static char __pyx_k_FMI_INTERNAL[] = "FMI_INTERNAL";
static char __pyx_k_FMI_NO_ALIAS[] = "FMI_NO_ALIAS";
static char __pyx_k_FMUException[] = "FMUException";
static char __pyx_k_RuntimeError[] = "RuntimeError";
static char __pyx_k_fmu_temp_dir[] = "fmu_temp_dir";
static char __pyx_k_pyfmi_common[] = "pyfmi.common";
static char __pyx_k_python3_flag[] = "python3_flag";
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_Unknown_input[] = "Unknown input.";
static char __pyx_k_allocated_xml[] = "allocated_xml";
static char __pyx_k_fmu_full_path[] = "fmu_full_path";
static char __pyx_k_get_causality[] = "_get_causality";
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_canRejectSteps[] = "canRejectSteps";
static char __pyx_k_convert_filter[] = "_convert_filter";
static char __pyx_k_enable_logging[] = "enable_logging";
static char __pyx_k_get_input_list[] = "get_input_list";
static char __pyx_k_latin_1_encode[] = "latin_1_encode";
static char __pyx_k_types_platform[] = "types_platform";
static char __pyx_k_FMI2_CONTINUOUS[] = "FMI2_CONTINUOUS";
static char __pyx_k_FMI_DERIVATIVES[] = "FMI_DERIVATIVES";
static char __pyx_k_FMI_ENUMERATION[] = "FMI_ENUMERATION";
static char __pyx_k_StopTimeDefined[] = "StopTimeDefined";
static char __pyx_k_canHandleEvents[] = "canHandleEvents";
static char __pyx_k_canSignalEvents[] = "canSignalEvents";
static char __pyx_k_create_temp_dir[] = "create_temp_dir";
static char __pyx_k_default_options[] = "_default_options";
static char __pyx_k_delete_temp_dir[] = "delete_temp_dir";
static char __pyx_k_get_derivatives[] = "get_derivatives";
static char __pyx_k_get_description[] = "_get_description";
static char __pyx_k_get_output_list[] = "get_output_list";
static char __pyx_k_get_states_list[] = "get_states_list";
static char __pyx_k_get_variability[] = "_get_variability";
static char __pyx_k_value_reference[] = "value_reference";
static char __pyx_k_An_FMU_exception[] = "\n    An FMU exception.\n    ";
static char __pyx_k_FMI2_ENUMERATION[] = "FMI2_ENUMERATION";
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_pyfmi_common_core[] = "pyfmi.common.core";
static char __pyx_k_relativeTolerance[] = "relativeTolerance";
static char __pyx_k_stop_time_defined[] = "stop_time_defined";
static char __pyx_k_tolerance_defined[] = "tolerance_defined";
static char __pyx_k_upcomingTimeEvent[] = "upcomingTimeEvent";
static char __pyx_k_FMI2_INITIAL_EXACT[] = "FMI2_INITIAL_EXACT";
static char __pyx_k_Type_not_supported[] = "Type not supported.";
static char __pyx_k_get_types_platform[] = "_get_types_platform";
static char __pyx_k_get_variable_fixed[] = "get_variable_fixed";
static char __pyx_k_get_variable_start[] = "get_variable_start";
static char __pyx_k_intermediateResult[] = "intermediateResult";
static char __pyx_k_iterationConverged[] = "iterationConverged";
static char __pyx_k_needsExecutionTool[] = "needsExecutionTool";
static char __pyx_k_stateValuesChanged[] = "stateValuesChanged";
static char __pyx_k_FMI1_DO_STEP_STATUS[] = "FMI1_DO_STEP_STATUS";
static char __pyx_k_FMI1_PENDING_STATUS[] = "FMI1_PENDING_STATUS";
static char __pyx_k_FMI2_INITIAL_APPROX[] = "FMI2_INITIAL_APPROX";
static char __pyx_k_NotImplementedError[] = "NotImplementedError";
static char __pyx_k_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_get_value_reference[] = "_get_value_reference";
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 char __pyx_k_FMI2_INITIAL_UNKNOWN[] = "FMI2_INITIAL_UNKNOWN";
static char __pyx_k_canGetAndSetFMUstate[] = "canGetAndSetFMUstate";
static char __pyx_k_canInterpolateInputs[] = "canInterpolateInputs";
static char __pyx_k_canSerializeFMUstate[] = "canSerializeFMUstate";
static char __pyx_k_get_capability_flags[] = "get_capability_flags";
static char __pyx_k_get_derivatives_list[] = "get_derivatives_list";
static char __pyx_k_get_variable_initial[] = "get_variable_initial";
static char __pyx_k_model_types_platform[] = "model_types_platform";
static char __pyx_k_nextEventTimeDefined[] = "nextEventTimeDefined";
static char __pyx_k_FMI_DEFAULT_LOG_LEVEL[] = "FMI_DEFAULT_LOG_LEVEL";
static char __pyx_k_FMI_REGISTER_GLOBALLY[] = "FMI_REGISTER_GLOBALLY";
static char __pyx_k_FMU_fmiStatus_d_s_s_s[] = "FMU: fmiStatus = %d;  %s (%s): %s\n";
static char __pyx_k_Unknown_variable_type[] = "Unknown variable type.";
static char __pyx_k_canRunAsynchronuously[] = "canRunAsynchronuously";
static char __pyx_k_deserialize_fmu_state[] = "deserialize_fmu_state";
static char __pyx_k_get_continuous_states[] = "_get_continuous_states";
static char __pyx_k_get_variable_valueref[] = "get_variable_valueref";
static char __pyx_k_internal_set_fmu_null[] = "_internal_set_fmu_null";
static char __pyx_k_set_continuous_states[] = "_set_continuous_states";
static char __pyx_k_FMI_MIME_CS_STANDALONE[] = "FMI_MIME_CS_STANDALONE";
static char __pyx_k_Failed_to_set_the_time[] = "Failed to set the time.";
static char __pyx_k_Logging_is_not_enabled[] = "Logging is not enabled";
static char __pyx_k_get_variable_causality[] = "get_variable_causality";
static char __pyx_k_get_variable_data_type[] = "get_variable_data_type";
static char __pyx_k_FMI2_INITIAL_CALCULATED[] = "FMI2_INITIAL_CALCULATED";
static char __pyx_k_Failed_to_reset_the_FMU[] = "Failed to reset the FMU.";
static char __pyx_k_exec_simulate_algorithm[] = "_exec_simulate_algorithm";
static char __pyx_k_newDiscreteStatesNeeded[] = "newDiscreteStatesNeeded";
static char __pyx_k_original_enable_logging[] = "original_enable_logging";
static char __pyx_k_Error_loading_the_binary[] = "Error loading the binary. ";
static char __pyx_k_common_algorithm_drivers[] = "common.algorithm_drivers";
static char __pyx_k_get_model_types_platform[] = "_get_model_types_platform";
static char __pyx_k_get_variable_description[] = "get_variable_description";
static char __pyx_k_get_variable_variability[] = "get_variable_variability";
static char __pyx_k_maxOutputDerivativeOrder[] = "maxOutputDerivativeOrder";
static char __pyx_k_FMI1_LAST_SUCCESSFUL_TIME[] = "FMI1_LAST_SUCCESSFUL_TIME";
static char __pyx_k_Not_supported_status_kind[] = "Not supported status kind.";
static char __pyx_k_The_XML_could_not_be_read[] = "The XML-could not be read. ";
static char __pyx_k_handle_load_fmu_exception[] = "_handle_load_fmu_exception";
static char __pyx_k_nominal_continuous_states[] = "nominal_continuous_states";
static char __pyx_k_serialized_fmu_state_size[] = "serialized_fmu_state_size";
static char __pyx_k_Failed_to_enter_event_mode[] = "Failed to enter event mode.";
static char __pyx_k_get_directional_derivative[] = "get_directional_derivative";
static char __pyx_k_FMIL_module_s_log_level_d_s[] = "FMIL: module = %s, log level = %d: %s\n";
static char __pyx_k_FMIL_module_s_log_lovel_d_s[] = "FMIL: module = %s, log lovel = %d: %s";
static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static char __pyx_k_pyfmi_fmi_algorithm_drivers[] = "pyfmi.fmi_algorithm_drivers";
static char __pyx_k_stateValueReferencesChanged[] = "stateValueReferencesChanged";
static char __pyx_k_The_FMU_version_is_not_found[] = "The FMU version is not found. ";
static char __pyx_k_Failed_to_get_the_Real_values[] = "Failed to get the Real values.";
static char __pyx_k_Failed_to_set_the_Real_values[] = "Failed to set the Real values.";
static char __pyx_k_get_nominal_continuous_states[] = "_get_nominal_continuous_states";
static char __pyx_k_Failed_to_setup_the_experiment[] = "Failed to setup the experiment.";
static char __pyx_k_The_FMU_version_is_unsupported[] = "The FMU version is unsupported. ";
static char __pyx_k_providesDirectionalDerivatives[] = "providesDirectionalDerivatives";
static char __pyx_k_Could_not_locate_the_FMU_in_the[] = "Could not locate the FMU in the specified directory.";
static char __pyx_k_Error_loading_the_binary_Enable[] = "Error loading the binary. Enable logging for possibly more information.";
static char __pyx_k_Exit_Initialize_returned_with_a[] = "Exit Initialize returned with a warning. Check the log for information (FMUModel.get_log).";
static char __pyx_k_Failed_to_enter_continuous_time[] = "Failed to enter continuous time mode.";
static char __pyx_k_Failed_to_instantiate_the_model[] = "Failed to instantiate the model. See the log for possibly more information.";
static char __pyx_k_Failed_to_instantiate_the_slave[] = "Failed to instantiate the slave. See the log for possibly more information.";
static char __pyx_k_Input_argument_kind_can_only_be[] = "Input-argument \"kind\" can only be \"ME\", \"CS\" or \"auto\" (default) and not: ";
static char __pyx_k_Module_containing_the_FMI_inter[] = "\nModule containing the FMI interface Python wrappers.\n";
static char __pyx_k_Property_for_accessing_the_curr[] = "\n    Property for accessing the current time of the simulation. Calls the\n    low-level FMI function: fmiSetTime.\n    ";
static char __pyx_k_Property_for_accessing_the_nomi[] = "\n    Property for accessing the nominal values of the continuous states. Calls\n    the low-level FMI function: fmiGetNominalContinuousStates.\n    ";
static char __pyx_k_Status_kind_has_to_be_between_0[] = "Status kind has to be between 0 and 3";
static char __pyx_k_The_attribute_enable_logging_is[] = "The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...";
static char __pyx_k_The_log_level_must_be_between_d[] = "The log level must be between %d and %d";
static char __pyx_k_The_number_of_variables_must_be[] = "The number of variables must be the same as the number of orders.";
static char __pyx_k_The_returned_derivatives_states[] = "The returned derivatives states list is NULL.";
static char __pyx_k_The_variable_type_does_not_have[] = "The variable type does not have a maximum value.";
static char __pyx_k_The_variable_with_the_valuref_i[] = "The variable with the valuref %i could not be found.";
static char __pyx_k_application_x_fmu_sharedlibrary[] = "application/x-fmu-sharedlibrary";
static char __pyx_k_must_be_a_subclass_of_common_al[] = " must be a subclass of common.algorithm_drivers.AlgorithmBase";
static char __pyx_k_provides_directional_derivative[] = "_provides_directional_derivatives";
static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_valuesOfContinuousStatesChanged[] = "valuesOfContinuousStatesChanged";
static char __pyx_k_An_error_occured_when_reseting_t[] = "An error occured when reseting the model, see the log for possible more information";
static char __pyx_k_An_error_occured_while_canceling[] = "An error occured while canceling the step";
static char __pyx_k_An_error_occured_while_getting_t[] = "An error occured while getting the directional derivative, see the log for possible more information";
static char __pyx_k_An_error_occured_while_retriving[] = "An error occured while retriving the status";
static char __pyx_k_C_Development_PyFMI_branches_PyF[] = "C:\\Development\\PyFMI\\branches\\PyFMI-2.1.x\\src\\pyfmi\\fmi.pyx";
static char __pyx_k_Currently_the_logging_of_categor[] = "Currently the logging of categories is not availible. See the docstring for more information";
static char __pyx_k_Either_provide_value_reference_o[] = "Either provide value reference or variable name.";
static char __pyx_k_Enter_Initialize_returned_with_a[] = "Enter Initialize returned with a warning. Check the log for information (FMUModel.get_log).";
static char __pyx_k_Exit_Initialize_returned_with_an[] = "Exit Initialize returned with an error. Check the log for information (FMUModel.get_log).";
static char __pyx_k_FMUModelBase2_cannot_be_used_dir[] = "FMUModelBase2 cannot be used directly, use FMUModelME2 or FMUModelCS2.";
static char __pyx_k_FMUModel_must_be_instantiated_wi[] = "FMUModel must be instantiated with an FMU (.fmu) file.";
static char __pyx_k_Failed_to_call_FMI_Completed_Ste[] = "Failed to call FMI Completed Step.";
static char __pyx_k_Failed_to_get_the_Boolean_values[] = "Failed to get the Boolean values.";
static char __pyx_k_Failed_to_get_the_Integer_values[] = "Failed to get the Integer values.";
static char __pyx_k_Failed_to_get_the_Real_output_de[] = "Failed to get the Real output derivatives.";
static char __pyx_k_Failed_to_get_the_continuous_sta[] = "Failed to get the continuous state reference values.";
static char __pyx_k_Failed_to_get_the_derivative_val[] = "Failed to get the derivative values at time: %E.";
static char __pyx_k_Failed_to_get_the_event_indicato[] = "Failed to get the event indicators.";
static char __pyx_k_Failed_to_get_the_nominal_values[] = "Failed to get the nominal values.";
static char __pyx_k_Failed_to_retrieve_the_continuou[] = "Failed to retrieve the continuous states.";
static char __pyx_k_Failed_to_retrieve_the_last_succ[] = "Failed to retrieve the last successful time. See the log for possibly more information.";
static char __pyx_k_Failed_to_set_the_Boolean_values[] = "Failed to set the Boolean values.";
static char __pyx_k_Failed_to_set_the_Integer_values[] = "Failed to set the Integer values.";
static char __pyx_k_Failed_to_set_the_Real_input_der[] = "Failed to set the Real input derivatives.";
static char __pyx_k_Failed_to_set_the_debugging_opti[] = "Failed to set the debugging option.";
static char __pyx_k_Failed_to_set_the_new_continuous[] = "Failed to set the new continuous states. The number of values are not consistent with the number of continuous states.";
static char __pyx_k_Failed_to_update_the_events_at_t[] = "Failed to update the events at time: %E.";
static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_Initialize_returned_with_a_warni[] = "Initialize returned with a warning. Check the log for information (FMUModel.get_log).";
static char __pyx_k_Initialize_returned_with_an_erro[] = "Initialize returned with an error. Check the log for information (FMUModel.get_log).";
static char __pyx_k_Invalid_log_level_for_FMI_Librar[] = "Invalid log level for FMI Library (0-7).";
static char __pyx_k_Models_that_need_an_execution_to[] = "Models that need an execution tool are not supported";
static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static char __pyx_k_PyFMI_currently_only_supports_FM[] = "PyFMI currently only supports FMI 1.0.";
static char __pyx_k_PyFMI_does_not_support_co_simula[] = "PyFMI does not support co-simulation tool";
static char __pyx_k_Setup_Experiment_has_to_be_calle[] = "Setup Experiment has to be called prior to the initialization method.";
static char __pyx_k_The_DLL_could_not_be_reloaded_ch[] = "The DLL could not be reloaded, check the log for more information.";
static char __pyx_k_The_FMU_does_not_support_input_d[] = "The FMU does not support input derivatives.";
static char __pyx_k_The_FMU_kind_could_not_be_determ[] = "The FMU kind could not be determined. ";
static char __pyx_k_The_FMU_version_could_not_be_det[] = "The FMU version could not be determined. ";
static char __pyx_k_The_FMU_version_is_not_found_Ena[] = "The FMU version is not found. Enable logging for possibly more information.";
static char __pyx_k_The_FMU_version_is_not_supported[] = "The FMU version is not supported by this class. ";
static char __pyx_k_The_FMU_version_is_unsupported_E[] = "The FMU version is unsupported. Enable logging for possibly more information.";
static char __pyx_k_The_XML_could_not_be_read_Enable[] = "The XML-could not be read. Enable logging for possible nore information.";
static char __pyx_k_The_XML_file_could_not_be_parsed[] = "The XML file could not be parsed. ";
static char __pyx_k_The_instance_is_not_curent_an_in[] = "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_The_length_of_the_list_with_vari[] = "The length of the list with variables (var_ref) and the seed vector (V) are not equal";
static char __pyx_k_The_length_of_valueref_and_value[] = "The length of valueref and values are inconsistent.";
static char __pyx_k_The_method_set_fmil_log_level_is[] = "The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.";
static char __pyx_k_The_order_must_be_greater_than_z[] = "The order must be greater than zero and below the maximum output derivative support of the FMU (%d).";
static char __pyx_k_The_returned_states_list_is_NULL[] = "The returned states list is NULL.";
static char __pyx_k_The_slave_failed_to_initialize_S[] = "The slave failed to initialize. See the log for possibly more information.";
static char __pyx_k_The_variable_is_not_a_real_varia[] = "The variable is not a real variable.";
static char __pyx_k_The_variable_s_could_not_be_foun[] = "The variable %s could not be found.";
static char __pyx_k_The_variable_s_does_not_have_a_s[] = "The variable %s does not have a start value.";
static char __pyx_k_The_variable_with_value_referenc[] = "The variable with value reference: %s, could not be found.";
static char __pyx_k_The_variables_must_either_be_a_s[] = "The variables must either be a string or a list of strings";
static char __pyx_k_This_FMU_does_not_provide_direct[] = "This FMU does not provide directional derivatives";
static char __pyx_k_This_class_only_supports_FMI_1_0[] = "This class only supports FMI 1.0 (Model Exchange and Co-Simulation).";
static char __pyx_k_This_class_only_supports_FMI_2_0[] = "This class only supports FMI 2.0 for Co-simulation.";
static char __pyx_k_WARNING_This_class_is_deprecated[] = "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_canBeInstantiatedOnlyOncePerProc[] = "canBeInstantiatedOnlyOncePerProcess";
static char __pyx_k_canHandleVariableCommunicationSt[] = "canHandleVariableCommunicationStepSize";
static char __pyx_k_canNotUseMemoryManagementFunctio[] = "canNotUseMemoryManagementFunctions";
static char __pyx_k_completedEventIterationIsProvide[] = "completedEventIterationIsProvided";
static char __pyx_k_completedIntegratorStepNotNeeded[] = "completedIntegratorStepNotNeeded";
static char __pyx_k_get_default_experiment_start_tim[] = "get_default_experiment_start_time";
static char __pyx_k_get_default_experiment_stop_time[] = "get_default_experiment_stop_time";
static char __pyx_k_get_default_experiment_tolerance[] = "get_default_experiment_tolerance";
static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static char __pyx_k_no_set_FMU_state_prior_to_curren[] = "no_set_FMU_state_prior_to_current_point";
static char __pyx_k_nominalsOfContinuousStatesChange[] = "nominalsOfContinuousStatesChanged";
static char __pyx_k_Exit_Initialize_returned_with_a_2[] = "Exit Initialize returned with a warning. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_Property_for_accessing_the_curr_2[] = "\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_Property_for_accessing_the_curr_3[] = "\n    Property for accessing the current time of the simulation. Calls the\n    low-level FMI function: fmiSetTime\n    ";
static char __pyx_k_Property_for_accessing_the_curr_4[] = "\n    Property for accessing the current values of the continuous states. Calls\n    the low-level FMI function: fmi2SetContinuousStates/fmi2GetContinuousStates.\n    ";
static char __pyx_k_Property_for_accessing_the_nomi_2[] = "\n    Property for accessing the nominal values of the continuous states. Calls\n    the low-level FMI function: fmi2GetNominalContinuousStates.\n    ";
static char __pyx_k_The_variable_type_does_not_have_2[] = "The variable type does not have a minimum value.";
static char __pyx_k_Enter_Initialize_returned_with_a_2[] = "Enter Initialize returned with a warning. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_Enter_Initialize_returned_with_a_3[] = "Enter Initialize returned with an error. Check the log for information (FMUModel.get_log).";
static char __pyx_k_Enter_Initialize_returned_with_a_4[] = "Enter Initialize returned with an error. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_Exit_Initialize_returned_with_an_2[] = "Exit Initialize returned with an error. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_Failed_to_set_the_debugging_opti_2[] = "Failed to set the debugging option. See the log for possibly more information.";
static char __pyx_k_Failed_to_set_the_new_continuous_2[] = "Failed to set the new continuous states.";
static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static char __pyx_k_Initialize_returned_with_a_warni_2[] = "Initialize returned with a warning. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_Initialize_returned_with_an_erro_2[] = "Initialize returned with an error. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_The_FMU_kind_could_not_be_determ_2[] = "The FMU kind could not be determined. Enable logging for possibly more information.";
static char __pyx_k_The_FMU_version_could_not_be_det_2[] = "The FMU version could not be determined. Enable logging for possibly more information.";
static char __pyx_k_The_FMU_version_is_not_supported_2[] = "The FMU version is not supported by this class. Enable logging for possibly more information.";
static char __pyx_k_The_XML_file_could_not_be_parsed_2[] = "The XML file could not be parsed. Enable logging for possibly more information.";
static char __pyx_k_The_order_must_be_greater_than_z_2[] = "The order must be greater than zero.";
static char __pyx_k_This_class_only_supports_FMI_1_0_2[] = "This class only supports FMI 1.0 for Co-simulation.";
static char __pyx_k_This_class_only_supports_FMI_1_0_3[] = "This class only supports FMI 1.0 for Model Exchange.";
static char __pyx_k_This_class_only_supports_FMI_2_0_2[] = "This class only supports FMI 2.0 for Model Exchange.";
static PyObject *__pyx_n_s_A;
static PyObject *__pyx_n_s_AlgorithmBase;
static PyObject *__pyx_kp_s_An_FMU_exception;
static PyObject *__pyx_kp_s_An_error_occured_when_reseting_t;
static PyObject *__pyx_kp_s_An_error_occured_while_canceling;
static PyObject *__pyx_kp_s_An_error_occured_while_getting_t;
static PyObject *__pyx_kp_s_An_error_occured_while_retriving;
static PyObject *__pyx_n_s_AssimuloFMIAlg;
static PyObject *__pyx_n_s_B;
static PyObject *__pyx_n_s_C;
static PyObject *__pyx_n_s_CS;
static PyObject *__pyx_kp_s_C_Development_PyFMI_branches_PyF;
static PyObject *__pyx_kp_s_Could_not_locate_the_FMU_in_the;
static PyObject *__pyx_kp_s_Currently_the_logging_of_categor;
static PyObject *__pyx_n_s_D;
static PyObject *__pyx_n_s_Default;
static PyObject *__pyx_kp_s_Either_provide_value_reference_o;
static PyObject *__pyx_kp_s_Enter_Initialize_returned_with_a;
static PyObject *__pyx_kp_s_Enter_Initialize_returned_with_a_2;
static PyObject *__pyx_kp_s_Enter_Initialize_returned_with_a_3;
static PyObject *__pyx_kp_s_Enter_Initialize_returned_with_a_4;
static PyObject *__pyx_kp_s_Error_loading_the_binary;
static PyObject *__pyx_kp_s_Error_loading_the_binary_Enable;
static PyObject *__pyx_n_s_Exception;
static PyObject *__pyx_kp_s_Exit_Initialize_returned_with_a;
static PyObject *__pyx_kp_s_Exit_Initialize_returned_with_a_2;
static PyObject *__pyx_kp_s_Exit_Initialize_returned_with_an;
static PyObject *__pyx_kp_s_Exit_Initialize_returned_with_an_2;
static PyObject *__pyx_n_s_FMI1_DO_STEP_STATUS;
static PyObject *__pyx_n_s_FMI1_LAST_SUCCESSFUL_TIME;
static PyObject *__pyx_n_s_FMI1_PENDING_STATUS;
static PyObject *__pyx_n_s_FMI2_BOOLEAN;
static PyObject *__pyx_n_s_FMI2_CONSTANT;
static PyObject *__pyx_n_s_FMI2_CONTINUOUS;
static PyObject *__pyx_n_s_FMI2_DISCRETE;
static PyObject *__pyx_n_s_FMI2_ENUMERATION;
static PyObject *__pyx_n_s_FMI2_FALSE;
static PyObject *__pyx_n_s_FMI2_FIXED;
static PyObject *__pyx_n_s_FMI2_INITIAL_APPROX;
static PyObject *__pyx_n_s_FMI2_INITIAL_CALCULATED;
static PyObject *__pyx_n_s_FMI2_INITIAL_EXACT;
static PyObject *__pyx_n_s_FMI2_INITIAL_UNKNOWN;
static PyObject *__pyx_n_s_FMI2_INPUT;
static PyObject *__pyx_n_s_FMI2_INTEGER;
static PyObject *__pyx_n_s_FMI2_OUTPUT;
static PyObject *__pyx_n_s_FMI2_REAL;
static PyObject *__pyx_n_s_FMI2_STRING;
static PyObject *__pyx_n_s_FMI2_TRUE;
static PyObject *__pyx_n_s_FMI2_TUNABLE;
static PyObject *__pyx_n_s_FMI2_UNKNOWN;
static PyObject *__pyx_n_s_FMICSAlg;
static PyObject *__pyx_kp_s_FMIL_module_s_log_level_d_s;
static PyObject *__pyx_kp_s_FMIL_module_s_log_lovel_d_s;
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_DEFAULT_LOG_LEVEL;
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_MIME_CS_STANDALONE;
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_REGISTER_GLOBALLY;
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_kp_s_FMUModelBase2_cannot_be_used_dir;
static PyObject *__pyx_kp_s_FMUModel_must_be_instantiated_wi;
static PyObject *__pyx_kp_s_FMU_fmiStatus_d_s_s_s;
static PyObject *__pyx_kp_s_FMU_is_a;
static PyObject *__pyx_kp_s_Failed_to_call_FMI_Completed_Ste;
static PyObject *__pyx_kp_s_Failed_to_enter_continuous_time;
static PyObject *__pyx_kp_s_Failed_to_enter_event_mode;
static PyObject *__pyx_kp_s_Failed_to_get_the_Boolean_values;
static PyObject *__pyx_kp_s_Failed_to_get_the_Integer_values;
static PyObject *__pyx_kp_s_Failed_to_get_the_Real_output_de;
static PyObject *__pyx_kp_s_Failed_to_get_the_Real_values;
static PyObject *__pyx_kp_s_Failed_to_get_the_continuous_sta;
static PyObject *__pyx_kp_s_Failed_to_get_the_derivative_val;
static PyObject *__pyx_kp_s_Failed_to_get_the_event_indicato;
static PyObject *__pyx_kp_s_Failed_to_get_the_nominal_values;
static PyObject *__pyx_kp_s_Failed_to_instantiate_the_model;
static PyObject *__pyx_kp_s_Failed_to_instantiate_the_slave;
static PyObject *__pyx_kp_s_Failed_to_reset_the_FMU;
static PyObject *__pyx_kp_s_Failed_to_retrieve_the_continuou;
static PyObject *__pyx_kp_s_Failed_to_retrieve_the_last_succ;
static PyObject *__pyx_kp_s_Failed_to_set_the_Boolean_values;
static PyObject *__pyx_kp_s_Failed_to_set_the_Integer_values;
static PyObject *__pyx_kp_s_Failed_to_set_the_Real_input_der;
static PyObject *__pyx_kp_s_Failed_to_set_the_Real_values;
static PyObject *__pyx_kp_s_Failed_to_set_the_debugging_opti;
static PyObject *__pyx_kp_s_Failed_to_set_the_debugging_opti_2;
static PyObject *__pyx_kp_s_Failed_to_set_the_new_continuous;
static PyObject *__pyx_kp_s_Failed_to_set_the_new_continuous_2;
static PyObject *__pyx_kp_s_Failed_to_set_the_time;
static PyObject *__pyx_kp_s_Failed_to_setup_the_experiment;
static PyObject *__pyx_kp_s_Failed_to_update_the_events_at_t;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
static PyObject *__pyx_kp_s_Initialize_returned_with_a_warni;
static PyObject *__pyx_kp_s_Initialize_returned_with_a_warni_2;
static PyObject *__pyx_kp_s_Initialize_returned_with_an_erro;
static PyObject *__pyx_kp_s_Initialize_returned_with_an_erro_2;
static PyObject *__pyx_kp_s_Input_argument_kind_can_only_be;
static PyObject *__pyx_kp_s_Invalid_log_level_for_FMI_Librar;
static PyObject *__pyx_kp_s_Logging_is_not_enabled;
static PyObject *__pyx_n_s_ME;
static PyObject *__pyx_n_s_Model;
static PyObject *__pyx_kp_s_Models_that_need_an_execution_to;
static PyObject *__pyx_n_s_N;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_kp_s_Not_supported_status_kind;
static PyObject *__pyx_n_s_OrderedDict;
static PyObject *__pyx_kp_s_Property_for_accessing_the_curr;
static PyObject *__pyx_kp_s_Property_for_accessing_the_curr_2;
static PyObject *__pyx_kp_s_Property_for_accessing_the_curr_3;
static PyObject *__pyx_kp_s_Property_for_accessing_the_curr_4;
static PyObject *__pyx_kp_s_Property_for_accessing_the_nomi;
static PyObject *__pyx_kp_s_Property_for_accessing_the_nomi_2;
static PyObject *__pyx_n_s_PyEventInfo;
static PyObject *__pyx_kp_s_PyFMI_currently_only_supports_FM;
static PyObject *__pyx_kp_s_PyFMI_does_not_support_co_simula;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_kp_s_Setup_Experiment_has_to_be_calle;
static PyObject *__pyx_n_s_Slave;
static PyObject *__pyx_kp_s_Status_kind_has_to_be_between_0;
static PyObject *__pyx_n_s_StopTimeDefined;
static PyObject *__pyx_kp_s_The_DLL_could_not_be_reloaded_ch;
static PyObject *__pyx_kp_s_The_FMU_does_not_support_input_d;
static PyObject *__pyx_kp_s_The_FMU_kind_could_not_be_determ;
static PyObject *__pyx_kp_s_The_FMU_kind_could_not_be_determ_2;
static PyObject *__pyx_kp_s_The_FMU_version_could_not_be_det;
static PyObject *__pyx_kp_s_The_FMU_version_could_not_be_det_2;
static PyObject *__pyx_kp_s_The_FMU_version_is_not_found;
static PyObject *__pyx_kp_s_The_FMU_version_is_not_found_Ena;
static PyObject *__pyx_kp_s_The_FMU_version_is_not_supported;
static PyObject *__pyx_kp_s_The_FMU_version_is_not_supported_2;
static PyObject *__pyx_kp_s_The_FMU_version_is_unsupported;
static PyObject *__pyx_kp_s_The_FMU_version_is_unsupported_E;
static PyObject *__pyx_kp_s_The_XML_could_not_be_read;
static PyObject *__pyx_kp_s_The_XML_could_not_be_read_Enable;
static PyObject *__pyx_kp_s_The_XML_file_could_not_be_parsed;
static PyObject *__pyx_kp_s_The_XML_file_could_not_be_parsed_2;
static PyObject *__pyx_kp_s_The_attribute_enable_logging_is;
static PyObject *__pyx_kp_s_The_instance_is_not_curent_an_in;
static PyObject *__pyx_kp_s_The_length_of_the_list_with_vari;
static PyObject *__pyx_kp_s_The_length_of_valueref_and_value;
static PyObject *__pyx_kp_s_The_log_level_must_be_between_d;
static PyObject *__pyx_kp_s_The_method_set_fmil_log_level_is;
static PyObject *__pyx_kp_s_The_number_of_variables_must_be;
static PyObject *__pyx_kp_s_The_order_must_be_greater_than_z;
static PyObject *__pyx_kp_s_The_order_must_be_greater_than_z_2;
static PyObject *__pyx_kp_s_The_returned_derivatives_states;
static PyObject *__pyx_kp_s_The_returned_states_list_is_NULL;
static PyObject *__pyx_kp_s_The_slave_failed_to_initialize_S;
static PyObject *__pyx_kp_s_The_variable_is_not_a_real_varia;
static PyObject *__pyx_kp_s_The_variable_s_could_not_be_foun;
static PyObject *__pyx_kp_s_The_variable_s_does_not_have_a_s;
static PyObject *__pyx_kp_s_The_variable_type_does_not_have;
static PyObject *__pyx_kp_s_The_variable_type_does_not_have_2;
static PyObject *__pyx_kp_s_The_variable_with_the_valuref_i;
static PyObject *__pyx_kp_s_The_variable_with_value_referenc;
static PyObject *__pyx_kp_s_The_variables_must_either_be_a_s;
static PyObject *__pyx_kp_s_This_FMU_does_not_provide_direct;
static PyObject *__pyx_kp_s_This_class_only_supports_FMI_1_0;
static PyObject *__pyx_kp_s_This_class_only_supports_FMI_1_0_2;
static PyObject *__pyx_kp_s_This_class_only_supports_FMI_1_0_3;
static PyObject *__pyx_kp_s_This_class_only_supports_FMI_2_0;
static PyObject *__pyx_kp_s_This_class_only_supports_FMI_2_0_2;
static PyObject *__pyx_kp_s_Type_not_supported;
static PyObject *__pyx_kp_s_Unknown_input;
static PyObject *__pyx_kp_s_Unknown_variable_type;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s_WARNING_This_class_is_deprecated;
static PyObject *__pyx_kp_s__10;
static PyObject *__pyx_kp_s__2;
static PyObject *__pyx_kp_s__207;
static PyObject *__pyx_kp_s__208;
static PyObject *__pyx_kp_s__23;
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_kp_s_and_not_a;
static PyObject *__pyx_kp_s_application_x_fmu_sharedlibrary;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_auto;
static PyObject *__pyx_n_s_base_path;
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_canBeInstantiatedOnlyOncePerProc;
static PyObject *__pyx_n_s_canGetAndSetFMUstate;
static PyObject *__pyx_n_s_canHandleEvents;
static PyObject *__pyx_n_s_canHandleVariableCommunicationSt;
static PyObject *__pyx_n_s_canInterpolateInputs;
static PyObject *__pyx_n_s_canNotUseMemoryManagementFunctio;
static PyObject *__pyx_n_s_canRejectSteps;
static PyObject *__pyx_n_s_canRunAsynchronuously;
static PyObject *__pyx_n_s_canSerializeFMUstate;
static PyObject *__pyx_n_s_canSignalEvents;
static PyObject *__pyx_n_s_categories;
static PyObject *__pyx_n_s_causality;
static PyObject *__pyx_n_s_codecs;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_kp_s_common_algorithm_drivers;
static PyObject *__pyx_n_s_compile;
static PyObject *__pyx_n_s_completedEventIterationIsProvide;
static PyObject *__pyx_n_s_completedIntegratorStepNotNeeded;
static PyObject *__pyx_n_s_context;
static PyObject *__pyx_n_s_continuous_states;
static PyObject *__pyx_n_s_convert_filter;
static PyObject *__pyx_n_s_create_temp_dir;
static PyObject *__pyx_n_s_create_temp_file;
static PyObject *__pyx_n_s_current_t;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_default_options;
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_deserialize_fmu_state;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_doc_2;
static PyObject *__pyx_n_s_double;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_empty;
static PyObject *__pyx_n_s_enable_logging;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_endswith;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_exec_simulate_algorithm;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_fget;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_filter;
static PyObject *__pyx_n_s_final_time;
static PyObject *__pyx_n_s_flat;
static PyObject *__pyx_n_s_flatten;
static PyObject *__pyx_n_s_float;
static PyObject *__pyx_n_s_fmu;
static PyObject *__pyx_n_s_fmu_1;
static PyObject *__pyx_n_s_fmu_1_kind;
static PyObject *__pyx_kp_s_fmu_2;
static PyObject *__pyx_n_s_fmu_2_2;
static PyObject *__pyx_n_s_fmu_2_kind;
static PyObject *__pyx_n_s_fmu_3;
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;
static PyObject *__pyx_n_s_get_alias;
static PyObject *__pyx_n_s_get_boolean;
static PyObject *__pyx_n_s_get_capability_flags;
static PyObject *__pyx_n_s_get_causality;
static PyObject *__pyx_n_s_get_continuous_states;
static PyObject *__pyx_n_s_get_default_experiment_start_tim;
static PyObject *__pyx_n_s_get_default_experiment_stop_time;
static PyObject *__pyx_n_s_get_default_experiment_tolerance;
static PyObject *__pyx_n_s_get_default_options;
static PyObject *__pyx_n_s_get_derivatives;
static PyObject *__pyx_n_s_get_derivatives_list;
static PyObject *__pyx_n_s_get_description;
static PyObject *__pyx_n_s_get_directional_derivative;
static PyObject *__pyx_n_s_get_initial;
static PyObject *__pyx_n_s_get_input_list;
static PyObject *__pyx_n_s_get_integer;
static PyObject *__pyx_n_s_get_log;
static PyObject *__pyx_n_s_get_model_types_platform;
static PyObject *__pyx_n_s_get_model_variables;
static PyObject *__pyx_n_s_get_name;
static PyObject *__pyx_n_s_get_nominal_continuous_states;
static PyObject *__pyx_n_s_get_output_list;
static PyObject *__pyx_n_s_get_real;
static PyObject *__pyx_n_s_get_result;
static PyObject *__pyx_n_s_get_states_list;
static PyObject *__pyx_n_s_get_string;
static PyObject *__pyx_n_s_get_time;
static PyObject *__pyx_n_s_get_type;
static PyObject *__pyx_n_s_get_types_platform;
static PyObject *__pyx_n_s_get_value_reference;
static PyObject *__pyx_n_s_get_variability;
static PyObject *__pyx_n_s_get_variable_causality;
static PyObject *__pyx_n_s_get_variable_data_type;
static PyObject *__pyx_n_s_get_variable_description;
static PyObject *__pyx_n_s_get_variable_fixed;
static PyObject *__pyx_n_s_get_variable_initial;
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_get_variable_valueref;
static PyObject *__pyx_n_s_get_variable_variability;
static PyObject *__pyx_n_s_get_version;
static PyObject *__pyx_n_s_handle_load_fmu_exception;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_include_alias;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_initial;
static PyObject *__pyx_n_s_input;
static PyObject *__pyx_n_s_instantiate;
static PyObject *__pyx_n_s_instantiate_model;
static PyObject *__pyx_n_s_instantiate_slave;
static PyObject *__pyx_n_s_int;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_s_intermediateResult;
static PyObject *__pyx_n_s_internal_set_fmu_null;
static PyObject *__pyx_n_s_isfile;
static PyObject *__pyx_n_s_iterationConverged;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kind;
static PyObject *__pyx_n_s_last_error;
static PyObject *__pyx_n_s_latin_1_encode;
static PyObject *__pyx_n_s_line;
static PyObject *__pyx_n_s_load_fmu;
static PyObject *__pyx_n_s_load_fmu_deprecated;
static PyObject *__pyx_n_s_log;
static PyObject *__pyx_n_s_log_file;
static PyObject *__pyx_n_s_log_file_c;
static PyObject *__pyx_n_s_log_file_name;
static PyObject *__pyx_n_s_log_level;
static PyObject *__pyx_kp_s_log_txt;
static PyObject *__pyx_n_s_logging;
static PyObject *__pyx_n_s_logging_on;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_match;
static PyObject *__pyx_n_s_maxOutputDerivativeOrder;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_model;
static PyObject *__pyx_n_s_model_types_platform;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_module_2;
static PyObject *__pyx_kp_s_must_be_a_subclass_of_common_al;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
static PyObject *__pyx_n_s_ndmin;
static PyObject *__pyx_n_s_needsExecutionTool;
static PyObject *__pyx_n_s_newDiscreteStatesNeeded;
static PyObject *__pyx_n_s_new_step;
static PyObject *__pyx_n_s_nextEventTime;
static PyObject *__pyx_n_s_nextEventTimeDefined;
static PyObject *__pyx_n_s_no_set_FMU_state_prior_to_curren;
static PyObject *__pyx_n_s_nominal_continuous_states;
static PyObject *__pyx_n_s_nominalsOfContinuousStatesChange;
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_original_enable_logging;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_prod;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_providesDirectionalDerivatives;
static PyObject *__pyx_n_s_provides_directional_derivative;
static PyObject *__pyx_n_s_pyfmi_common;
static PyObject *__pyx_n_s_pyfmi_common_core;
static PyObject *__pyx_n_s_pyfmi_fmi;
static PyObject *__pyx_kp_s_pyfmi_fmi_algorithm_drivers;
static PyObject *__pyx_n_s_python3_flag;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_re;
static PyObject *__pyx_n_s_readline;
static PyObject *__pyx_n_s_relativeTolerance;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_serialize_fmu_state;
static PyObject *__pyx_n_s_serialized_fmu_state_size;
static PyObject *__pyx_n_s_set;
static PyObject *__pyx_n_s_set_boolean;
static PyObject *__pyx_n_s_set_continuous_states;
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_set_time;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_solve;
static PyObject *__pyx_n_s_start_time;
static PyObject *__pyx_n_s_stateValueReferencesChanged;
static PyObject *__pyx_n_s_stateValuesChanged;
static PyObject *__pyx_n_s_step_size;
static PyObject *__pyx_n_s_stop_time;
static PyObject *__pyx_n_s_stop_time_defined;
static PyObject *__pyx_n_s_strip;
static PyObject *__pyx_n_s_structured;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_tStart;
static PyObject *__pyx_n_s_tStop;
static PyObject *__pyx_n_s_terminateSimulation;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_tolControlled;
static PyObject *__pyx_n_s_tolerance;
static PyObject *__pyx_n_s_tolerance_defined;
static PyObject *__pyx_n_s_translate;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_types_platform;
static PyObject *__pyx_n_s_uint32;
static PyObject *__pyx_n_s_unknown;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
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_valuesOfContinuousStatesChanged;
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_x;
static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_n_s_zeros;
static PyObject *__pyx_float_0_0;
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_float_0_01;
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_k__3;
static PyObject *__pyx_k__4;
static PyObject *__pyx_k__5;
static PyObject *__pyx_k__6;
static PyObject *__pyx_k__7;
static PyObject *__pyx_k__8;
static PyObject *__pyx_k__9;
static PyObject *__pyx_k__11;
static PyObject *__pyx_k__46;
static PyObject *__pyx_k__57;
static PyObject *__pyx_k__62;
static PyObject *__pyx_k__79;
static PyObject *__pyx_k__80;
static PyObject *__pyx_k__121;
static PyObject *__pyx_k__139;
static PyObject *__pyx_k__159;
static PyObject *__pyx_k__160;
static PyObject *__pyx_k__172;
static PyObject *__pyx_k__181;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_slice__131;
static PyObject *__pyx_slice__132;
static PyObject *__pyx_slice__133;
static PyObject *__pyx_slice__134;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_tuple__140;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__146;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__148;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__150;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__152;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__154;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__156;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__158;
static PyObject *__pyx_tuple__161;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__164;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__166;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__168;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__170;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__174;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__176;
static PyObject *__pyx_tuple__177;
static PyObject *__pyx_tuple__178;
static PyObject *__pyx_tuple__179;
static PyObject *__pyx_tuple__180;
static PyObject *__pyx_tuple__182;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_tuple__184;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__186;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__188;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__190;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__192;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__194;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__196;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__198;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__209;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__214;
static PyObject *__pyx_codeobj__200;
static PyObject *__pyx_codeobj__202;
static PyObject *__pyx_codeobj__204;
static PyObject *__pyx_codeobj__206;
static PyObject *__pyx_codeobj__211;
static PyObject *__pyx_codeobj__213;
static PyObject *__pyx_codeobj__215;

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":43
 *     import codecs
 *     def encode(x):
 *         return codecs.latin_1_encode(x)[0]             # <<<<<<<<<<<<<<
 *     def decode(x):
 *         return x.decode()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_codecs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_latin_1_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __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 = NULL;
    __Pyx_INCREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":45
 *         return codecs.latin_1_encode(x)[0]
 *     def decode(x):
 *         return x.decode()             # <<<<<<<<<<<<<<
 * else:
 *     def encode(x):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":141
 * 
 * #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":143
 * 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) != 0);
  if (__pyx_t_1) {

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

  /* "pyfmi\fmi.pyx":141
 * 
 * #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:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pyfmi.fmi.importlogger", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":147
 * 
 * #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":149
 * 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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":150
 *     #print "FMIL: module = %s, log lovel = %d: %s" %(module, log_level, message)
 *     if c.context != NULL:
 *         (<FMUModelBase2>c.context)._logger(module, log_level, message)             # <<<<<<<<<<<<<<
 * 
 * cdef void  importlogger_fmi2(FMIL.fmi2_component_environment_t c, FMIL.fmi2_string_t instanceName, FMIL.fmi2_status_t status, FMIL.fmi2_string_t category, FMIL.fmi2_string_t message, ...):
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_c->context)->__pyx_vtab)->_logger(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_c->context), __pyx_v_module, __pyx_v_log_level, __pyx_v_message); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __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:;

  /* "pyfmi\fmi.pyx":147
 * 
 * #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:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pyfmi.fmi.importlogger2", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

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

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

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

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

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

/* "pyfmi\fmi.pyx":158
 * 
 * #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;
  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("importlogger_load_fmu", 0);

  /* "pyfmi\fmi.pyx":159
 * #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 = __Pyx_PyBytes_FromString(((char *)__pyx_v_c->context)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __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 = 159; __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_INCREF(__pyx_n_s_a);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_a);
    __Pyx_GIVEREF(__pyx_n_s_a);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_t_2;
    __pyx_t_2 = 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_v_file = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "pyfmi\fmi.pyx":160
 * 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_module); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_log_level); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_t_2 = 0;
          __pyx_t_5 = 0;
          __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_FMIL_module_s_log_level_d_s, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          if (!__pyx_t_10) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_9);
            __pyx_t_9 = 0;
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_L14_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "pyfmi\fmi.pyx":159
 * #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_4, &__pyx_t_1, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_9 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_12 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __pyx_t_13 = ((!(__pyx_t_12 != 0)) != 0);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_5);
            __Pyx_ErrRestore(__pyx_t_4, __pyx_t_1, __pyx_t_5);
            __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_5 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_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_L8_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_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_3) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L18;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L1_error;
    __pyx_L18:;
  }

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

  /* function exit code */
  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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_WriteUnraisable("pyfmi.fmi.importlogger_load_fmu", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":166
 * 
 * #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":169
 *     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":170
 *     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":171
 *     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":172
 *     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 = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_instanceName); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_category); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_buf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __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, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_FMU_fmiStatus_d_s_s_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PrintOne(0, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":166
 * 
 * #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
 */

  /* function exit code */
  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, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

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

/* 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_variable_name,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_variable_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __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 = 179; __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 = 179; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __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;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set", 0);

  /* "pyfmi\fmi.pyx":197
 *             (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_PyBaseString_Check(__pyx_v_variable_name); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":198
 *         """
 *         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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __Pyx_INCREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":200
 *             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_6 = PyObject_Length(__pyx_v_variable_name); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_6; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "pyfmi\fmi.pyx":201
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_variable_name, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
      }
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_7 = 0;
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  }
  __pyx_L3:;

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

  /* function exit code */
  __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_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);

  /* "pyfmi\fmi.pyx":224
 *             (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_PyBaseString_Check(__pyx_v_variable_name); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":225
 *         """
 *         if isinstance(variable_name, basestring):
 *             return self._get(variable_name) #Scalar case             # <<<<<<<<<<<<<<
 *         else:
 *             ret = []
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); 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_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_variable_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":227
 *             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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_ret = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":228
 *         else:
 *             ret = []
 *             for i in xrange(len(variable_name)): #A list of variables             # <<<<<<<<<<<<<<
 *                 ret += [self._get(variable_name[i])]
 *             return ret
 */
    __pyx_t_7 = PyObject_Length(__pyx_v_variable_name); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "pyfmi\fmi.pyx":229
 *             ret = []
 *             for i in xrange(len(variable_name)): #A list of variables
 *                 ret += [self._get(variable_name[i])]             # <<<<<<<<<<<<<<
 *             return ret
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_variable_name, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __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 = 229; __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 = PyNumber_InPlaceAdd(__pyx_v_ret, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_ret, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;
    }

    /* "pyfmi\fmi.pyx":230
 *             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(__pyx_v_ret);
    __pyx_r = __pyx_v_ret;
    goto __pyx_L0;
  }

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_exec_algorithm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_module,&__pyx_n_s_algorithm,&__pyx_n_s_options,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_module)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_algorithm)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_algorithm", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_algorithm", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __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 = 232; __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 = 232; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  Py_ssize_t __pyx_t_7;
  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":242
 *             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(__pyx_kp_s_common_algorithm_drivers);
  __pyx_v_base_path = __pyx_kp_s_common_algorithm_drivers;

  /* "pyfmi\fmi.pyx":243
 *         """
 *         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 = 243; __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 = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_v_AlgorithmBase) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_AlgorithmBase, __pyx_v_AlgorithmBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_alg) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alg, __pyx_v_alg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algdrive) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_algdrive, __pyx_v_algdrive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algorithm) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_algorithm, __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_base_path) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_base_path, __pyx_v_base_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_module) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_module, __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_options) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_options, __pyx_v_options) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (((PyObject *)__pyx_v_self)) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_self, ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __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 = 243; __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 = 243; __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, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __Pyx_GIVEREF(__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 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_algdrive = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":244
 *         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 = __Pyx_GetAttr(__pyx_v_algdrive, __pyx_n_s_algorithm_drivers); 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 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_s_AlgorithmBase); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_AlgorithmBase = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":246
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')
 * 
 *         if isinstance(algorithm, basestring):             # <<<<<<<<<<<<<<
 *             module = __import__(module, globals(), locals(), [algorithm], -1)
 *             algorithm = getattr(module, algorithm)
 */
  __pyx_t_5 = __Pyx_PyBaseString_Check(__pyx_v_algorithm); 
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":247
 * 
 *         if isinstance(algorithm, basestring):
 *             module = __import__(module, globals(), locals(), [algorithm], -1)             # <<<<<<<<<<<<<<
 *             algorithm = getattr(module, algorithm)
 * 
 */
    __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_v_AlgorithmBase) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_AlgorithmBase, __pyx_v_AlgorithmBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_alg) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alg, __pyx_v_alg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_algdrive) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_algdrive, __pyx_v_algdrive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_algorithm) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_algorithm, __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_base_path) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_base_path, __pyx_v_base_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_module) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_module, __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_options) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_options, __pyx_v_options) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (((PyObject *)__pyx_v_self)) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_self, ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_algorithm);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_algorithm);
    __Pyx_GIVEREF(__pyx_v_algorithm);
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_module);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_module);
    __Pyx_GIVEREF(__pyx_v_module);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_int_neg_1);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_int_neg_1);
    __Pyx_GIVEREF(__pyx_int_neg_1);
    __pyx_t_4 = 0;
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_module, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":248
 *         if isinstance(algorithm, basestring):
 *             module = __import__(module, globals(), locals(), [algorithm], -1)
 *             algorithm = getattr(module, algorithm)             # <<<<<<<<<<<<<<
 * 
 *         if not issubclass(algorithm, AlgorithmBase):
 */
    __pyx_t_2 = __Pyx_GetAttr(__pyx_v_module, __pyx_v_algorithm); 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_DECREF_SET(__pyx_v_algorithm, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

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

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

  /* "pyfmi\fmi.pyx":255
 * 
 *         # initialize algorithm
 *         alg = algorithm(self, options)             # <<<<<<<<<<<<<<
 *         # solve optimization problem/initialize
 *         alg.solve()
 */
  __Pyx_INCREF(__pyx_v_algorithm);
  __pyx_t_1 = __pyx_v_algorithm; __pyx_t_3 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __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_1); __pyx_t_1 = 0;
  __pyx_v_alg = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":257
 *         alg = algorithm(self, options)
 *         # solve optimization problem/initialize
 *         alg.solve()             # <<<<<<<<<<<<<<
 *         # get and return result
 *         return alg.get_result()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_alg, __pyx_n_s_solve); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":259
 *         alg.solve()
 *         # get and return result
 *         return alg.get_result()             # <<<<<<<<<<<<<<
 * 
 *     def _exec_simulate_algorithm(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_alg, __pyx_n_s_get_result); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

/* 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_exec_simulate_algorithm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start_time,&__pyx_n_s_final_time,&__pyx_n_s_input,&__pyx_n_s_module,&__pyx_n_s_algorithm,&__pyx_n_s_options,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_time)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_final_time)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_module)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_algorithm)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __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 = 261; __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 = 261; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  Py_ssize_t __pyx_t_7;
  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":277
 *             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(__pyx_kp_s_common_algorithm_drivers);
  __pyx_v_base_path = __pyx_kp_s_common_algorithm_drivers;

  /* "pyfmi\fmi.pyx":278
 *         """
 *         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 = 278; __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 = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_v_AlgorithmBase) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_AlgorithmBase, __pyx_v_AlgorithmBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_alg) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alg, __pyx_v_alg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algdrive) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_algdrive, __pyx_v_algdrive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algorithm) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_algorithm, __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_base_path) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_base_path, __pyx_v_base_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_final_time) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_final_time, __pyx_v_final_time) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_input) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_input, __pyx_v_input) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_module) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_module, __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_options) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_options, __pyx_v_options) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (((PyObject *)__pyx_v_self)) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_self, ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_start_time) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_start_time, __pyx_v_start_time) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __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 = 278; __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 = 278; __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, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_algdrive = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":279
 *         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 = __Pyx_GetAttr(__pyx_v_algdrive, __pyx_n_s_algorithm_drivers); 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);
  __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_s_AlgorithmBase); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_AlgorithmBase = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":281
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')
 * 
 *         if isinstance(algorithm, basestring):             # <<<<<<<<<<<<<<
 *             module = __import__(module, globals(), locals(), [algorithm], 0)
 *             algorithm = getattr(module, algorithm)
 */
  __pyx_t_5 = __Pyx_PyBaseString_Check(__pyx_v_algorithm); 
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":282
 * 
 *         if isinstance(algorithm, basestring):
 *             module = __import__(module, globals(), locals(), [algorithm], 0)             # <<<<<<<<<<<<<<
 *             algorithm = getattr(module, algorithm)
 * 
 */
    __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_v_AlgorithmBase) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_AlgorithmBase, __pyx_v_AlgorithmBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_alg) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alg, __pyx_v_alg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_algdrive) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_algdrive, __pyx_v_algdrive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_algorithm) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_algorithm, __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_base_path) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_base_path, __pyx_v_base_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_final_time) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_final_time, __pyx_v_final_time) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_input) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_input, __pyx_v_input) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_module) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_module, __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_options) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_options, __pyx_v_options) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (((PyObject *)__pyx_v_self)) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_self, ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_start_time) {
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_start_time, __pyx_v_start_time) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_algorithm);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_algorithm);
    __Pyx_GIVEREF(__pyx_v_algorithm);
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_module);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_module);
    __Pyx_GIVEREF(__pyx_v_module);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_t_4 = 0;
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_module, __pyx_t_2);
    __pyx_t_2 = 0;

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

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

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

  /* "pyfmi\fmi.pyx":290
 * 
 *         # initialize algorithm
 *         alg = algorithm(start_time, final_time, input, self, options)             # <<<<<<<<<<<<<<
 *         # simulate
 *         alg.solve()
 */
  __Pyx_INCREF(__pyx_v_algorithm);
  __pyx_t_1 = __pyx_v_algorithm; __pyx_t_3 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(5+__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_start_time);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_start_time);
  __Pyx_GIVEREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_final_time);
  __Pyx_GIVEREF(__pyx_v_final_time);
  __Pyx_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_v_input);
  __Pyx_GIVEREF(__pyx_v_input);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_7, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_4, 4+__pyx_t_7, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __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_1); __pyx_t_1 = 0;
  __pyx_v_alg = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":292
 *         alg = algorithm(start_time, final_time, input, self, options)
 *         # simulate
 *         alg.solve()             # <<<<<<<<<<<<<<
 *         # get and return result
 *         return alg.get_result()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_alg, __pyx_n_s_solve); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":294
 *         alg.solve()
 *         # get and return result
 *         return alg.get_result()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_alg, __pyx_n_s_get_result); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

/* 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_default_options (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_module,&__pyx_n_s_algorithm,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_module)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_algorithm)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_default_options", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __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 = 297; __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 = 297; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":302
 *         'algorithm'.
 *         """
 *         module = __import__(module, globals(), locals(), [algorithm], 0)             # <<<<<<<<<<<<<<
 *         algorithm = getattr(module, algorithm)
 * 
 */
  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __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 = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_v_algorithm) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_algorithm, __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_module) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_module, __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (((PyObject *)__pyx_v_self)) {
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_self, ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __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 = 302; __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 = 302; __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, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_module, __pyx_t_3);
  __pyx_t_3 = 0;

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

  /* "pyfmi\fmi.pyx":305
 *         algorithm = getattr(module, algorithm)
 * 
 *         return algorithm.get_default_options()             # <<<<<<<<<<<<<<
 * 
 * class FMUException(Exception):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_algorithm, __pyx_n_s_get_default_options); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":321
 *     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,
 */

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_14ScalarVariable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_14ScalarVariable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value_reference = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_description = 0;
  PyObject *__pyx_v_variability = 0;
  PyObject *__pyx_v_causality = 0;
  PyObject *__pyx_v_alias = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value_reference,&__pyx_n_s_type,&__pyx_n_s_description,&__pyx_n_s_variability,&__pyx_n_s_causality,&__pyx_n_s_alias,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_kp_s__2);
    values[4] = __pyx_k__3;
    values[5] = __pyx_k__4;
    values[6] = __pyx_k__5;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_reference)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __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 = 321; __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 = 321; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":326
 *                        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":327
 * 
 *         self._name            = name
 *         self._value_reference = value_reference             # <<<<<<<<<<<<<<
 *         self._type            = type
 *         self._description     = description
 */
  __pyx_t_1 = __Pyx_PyInt_As_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 = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_value_reference = __pyx_t_1;

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

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

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

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

  /* "pyfmi\fmi.pyx":321
 *     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,
 */

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":342
 *             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;

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

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":353
 *             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_From_fmi1_value_reference_t(__pyx_v_self->_value_reference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":365
 *             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 = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":377
 *             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;

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

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":389
 *             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 = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":401
 *             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 = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":413
 *             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 = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":420
 *     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,
 */

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_15ScalarVariable2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_15ScalarVariable2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value_reference = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_description = 0;
  PyObject *__pyx_v_variability = 0;
  PyObject *__pyx_v_causality = 0;
  PyObject *__pyx_v_alias = 0;
  PyObject *__pyx_v_initial = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value_reference,&__pyx_n_s_type,&__pyx_n_s_description,&__pyx_n_s_variability,&__pyx_n_s_causality,&__pyx_n_s_alias,&__pyx_n_s_initial,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_kp_s__2);
    values[4] = __pyx_k__6;
    values[5] = __pyx_k__7;
    values[6] = __pyx_k__8;
    values[7] = __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  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_reference)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_description);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_variability);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_causality);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alias);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_initial);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_value_reference = values[1];
    __pyx_v_type = values[2];
    __pyx_v_description = values[3];
    __pyx_v_variability = values[4];
    __pyx_v_causality = values[5];
    __pyx_v_alias = values[6];
    __pyx_v_initial = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_15ScalarVariable2___init__(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)__pyx_v_self), __pyx_v_name, __pyx_v_value_reference, __pyx_v_type, __pyx_v_description, __pyx_v_variability, __pyx_v_causality, __pyx_v_alias, __pyx_v_initial);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

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

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

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

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

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

  /* "pyfmi\fmi.pyx":420
 *     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,
 */

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":443
 *             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;

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

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":454
 *             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 = 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;

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

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":466
 *             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 = 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;

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

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":478
 *             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;

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

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":490
 *             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 = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":502
 *             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 = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":514
 *             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 = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_16_get_initial(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_initial", 0);

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable2._get_initial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":535
 *     """
 *     def __init__(self):
 *         self.fmu_state = NULL             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->fmu_state = NULL;

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

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase___init__[] = "\n        Constructor.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__;
#endif
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fmu,&__pyx_n_s_path,&__pyx_n_s_enable_logging,&__pyx_n_s_log_file_name,&__pyx_n_s_log_level,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s__10);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_kp_s__2);
    values[4] = __pyx_k__11;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_level);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __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 = 543; __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);

  /* function exit code */
  __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;
  char *__pyx_v_last_error;
  enum fmi1_fmu_kind_enu_t __pyx_v_fmu_kind;
  PyObject *__pyx_v_fmu_log_name = NULL;
  PyObject *__pyx_v_file = NULL;
  Py_ssize_t __pyx_v_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  jm_log_level_enu_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  char *__pyx_t_11;
  char *__pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  Py_ssize_t __pyx_t_18;
  PyObject *__pyx_t_19 = 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":551
 * 
 *         #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 = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_log);
  __Pyx_DECREF(__pyx_v_self->_log);
  __pyx_v_self->_log = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":555
 *         #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":556
 *         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":557
 *         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":558
 *         self._allocated_xml = 0
 *         self._allocated_fmu = 0
 *         self._allocated_list = False             # <<<<<<<<<<<<<<
 *         self._fmu_temp_dir = NULL
 *         self._fmu_log_name = NULL
 */
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __Pyx_GOTREF(__pyx_v_self->_allocated_list);
  __Pyx_DECREF(__pyx_v_self->_allocated_list);
  __pyx_v_self->_allocated_list = Py_False;

  /* "pyfmi\fmi.pyx":559
 *         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":560
 *         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":563
 * 
 *         #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":564
 *         #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":565
 *         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":566
 *         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":567
 *         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":568
 *         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":570
 *         self.callbacks.context = <void*>self #Class loggger
 * 
 *         if enable_logging==None:             # <<<<<<<<<<<<<<
 *             if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:
 *                 if log_level == FMIL.jm_log_level_nothing:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_enable_logging, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":571
 * 
 *         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 = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_3 = PyInt_FromLong(jm_log_level_all); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = __pyx_t_4;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_2) {

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

        /* "pyfmi\fmi.pyx":573
 *             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_INCREF(Py_False);
        __Pyx_DECREF_SET(__pyx_v_enable_logging, Py_False);
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":575
 *                     enable_logging = False
 *                 else:
 *                     enable_logging = True             # <<<<<<<<<<<<<<
 *                 self.callbacks.log_level = log_level
 *             else:
 */
        __Pyx_INCREF(Py_True);
        __Pyx_DECREF_SET(__pyx_v_enable_logging, Py_True);
      }
      __pyx_L7:;

      /* "pyfmi\fmi.pyx":576
 *                 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_5 = ((jm_log_level_enu_t)PyInt_AsLong(__pyx_v_log_level)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_self->callbacks.log_level = __pyx_t_5;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":578
 *                 self.callbacks.log_level = log_level
 *             else:
 *                 raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))             # <<<<<<<<<<<<<<
 *         else:
 *             logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__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_6 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyInt_FromLong(jm_log_level_all); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __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 = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_The_log_level_must_be_between_d, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, 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_6); __pyx_t_6 = 0;
      }
      __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;}
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":580
 *                 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __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_3); __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":581
 *         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_2 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {
      __pyx_t_5 = jm_log_level_info;
    } else {
      __pyx_t_5 = jm_log_level_error;
    }
    __pyx_v_self->callbacks.log_level = __pyx_t_5;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":583
 *             self.callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error
 * 
 *         fmu_full_path = os.path.abspath(os.path.join(path,fmu))             # <<<<<<<<<<<<<<
 *         fmu_temp_dir  = encode(create_temp_dir())
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_abspath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_join); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_9 = 1;
    }
  }
  __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_8) {
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
  }
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
    PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); 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_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fmu_full_path = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":584
 * 
 *         fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *         fmu_temp_dir  = encode(create_temp_dir())             # <<<<<<<<<<<<<<
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_temp_dir, fmu_temp_dir)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_create_temp_dir); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (__pyx_t_7) {
    __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fmu_temp_dir = __pyx_t_3;
  __pyx_t_3 = 0;

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

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

  /* "pyfmi\fmi.pyx":589
 * 
 *         # 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 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmu_full_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__13, NULL); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((!__pyx_t_2) != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":590
 *         # 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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __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 = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":593
 * 
 *         #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":594
 *         #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":595
 *         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":596
 *         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":598
 *         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":599
 * 
 *         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":602
 * 
 *         #Get the FMI version of the provided model
 *         fmu_full_path = encode(fmu_full_path)             # <<<<<<<<<<<<<<
 *         version = FMIL.fmi_import_get_fmi_version(self.context, fmu_full_path, fmu_temp_dir)
 *         self._version = version #Store version
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_fmu_full_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_INCREF(__pyx_v_fmu_full_path);
    PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_fmu_full_path);
    __Pyx_GIVEREF(__pyx_v_fmu_full_path);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_fmu_full_path, __pyx_t_3);
  __pyx_t_3 = 0;

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

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

  /* "pyfmi\fmi.pyx":606
 *         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_4 = ((__pyx_v_version == fmi_version_unknown_enu) != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":607
 * 
 *         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":608
 *         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_4 = ((__pyx_v_self->callbacks.log_level >= jm_log_level_error) != 0);
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":609
 *             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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = PyNumber_Add(__pyx_kp_s_The_FMU_version_could_not_be_det, __pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_10) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __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 = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":611
 *                 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __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 = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

  /* "pyfmi\fmi.pyx":612
 *             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_4 = ((__pyx_v_version != 1) != 0);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":616
 * 
 *         #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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_fmu = fmi1_import_parse_xml(__pyx_v_self->context, __pyx_t_12);

  /* "pyfmi\fmi.pyx":617
 *         #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_4 = ((__pyx_v_self->_fmu == NULL) != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":618
 *         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":619
 *         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_4 = ((__pyx_v_self->callbacks.log_level >= jm_log_level_error) != 0);
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":620
 *             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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyNumber_Add(__pyx_kp_s_The_XML_file_could_not_be_parsed, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __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 = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

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

  /* "pyfmi\fmi.pyx":623
 *             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":626
 * 
 *         #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_v_fmu_kind = fmi1_import_get_fmu_kind(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":627
 *         #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 = PyInt_FromLong(__pyx_v_fmu_kind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_ME); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__pyx_t_2) {
  } else {
    __pyx_t_4 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_10 = PyInt_FromLong(__pyx_v_fmu_kind); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_CS_STANDALONE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":629
 *         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_v_self->_fmu_kind = __pyx_v_fmu_kind;

  /* "pyfmi\fmi.pyx":633
 *         #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_GetModuleGlobalName(__pyx_n_s_FMI_REGISTER_GLOBALLY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __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_13);

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

    /* "pyfmi\fmi.pyx":635
 *         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":636
 *         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) != 0);
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":637
 *             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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __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 = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":639
 *                 raise FMUException(last_error)
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         self._allocated_dll = 1
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __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 = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

  /* "pyfmi\fmi.pyx":640
 *             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":641
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")
 *         self._allocated_dll = 1
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_REGISTER_GLOBALLY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __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_d, __pyx_n_s_FMI_REGISTER_GLOBALLY, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":644
 * 
 *         #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":647
 * 
 *         #Internal values
 *         self._file_open = False             # <<<<<<<<<<<<<<
 *         self._npoints = 0
 *         self._enable_logging = enable_logging
 */
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __Pyx_GOTREF(__pyx_v_self->_file_open);
  __Pyx_DECREF(__pyx_v_self->_file_open);
  __pyx_v_self->_file_open = Py_False;

  /* "pyfmi\fmi.pyx":648
 *         #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":649
 *         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":650
 *         self._npoints = 0
 *         self._enable_logging = enable_logging
 *         self._pyEventInfo = PyEventInfo()             # <<<<<<<<<<<<<<
 * 
 *         #Load information from model
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PyEventInfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->_pyEventInfo);
  __Pyx_DECREF(__pyx_v_self->_pyEventInfo);
  __pyx_v_self->_pyEventInfo = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":653
 * 
 *         #Load information from model
 *         self._modelid = decode(FMIL.fmi1_import_get_model_identifier(self._fmu))             # <<<<<<<<<<<<<<
 *         self._modelname = decode(FMIL.fmi1_import_get_model_name(self._fmu))
 *         self._nEventIndicators = FMIL.fmi1_import_get_number_of_event_indicators(self._fmu)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyBytes_FromString(fmi1_import_get_model_identifier(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_10) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->_modelid);
  __Pyx_DECREF(__pyx_v_self->_modelid);
  __pyx_v_self->_modelid = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":654
 *         #Load information from model
 *         self._modelid = decode(FMIL.fmi1_import_get_model_identifier(self._fmu))
 *         self._modelname = decode(FMIL.fmi1_import_get_model_name(self._fmu))             # <<<<<<<<<<<<<<
 *         self._nEventIndicators = FMIL.fmi1_import_get_number_of_event_indicators(self._fmu)
 *         self._nContinuousStates = FMIL.fmi1_import_get_number_of_continuous_states(self._fmu)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyBytes_FromString(fmi1_import_get_model_name(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->_modelname);
  __Pyx_DECREF(__pyx_v_self->_modelname);
  __pyx_v_self->_modelname = __pyx_t_3;
  __pyx_t_3 = 0;

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

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

  /* "pyfmi\fmi.pyx":657
 *         self._nEventIndicators = FMIL.fmi1_import_get_number_of_event_indicators(self._fmu)
 *         self._nContinuousStates = FMIL.fmi1_import_get_number_of_continuous_states(self._fmu)
 *         fmu_log_name = encode((self._modelid + "_log.txt") if log_file_name=="" else log_file_name)             # <<<<<<<<<<<<<<
 *         self._fmu_log_name = <char*>FMIL.malloc((FMIL.strlen(fmu_log_name)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_log_name, fmu_log_name)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_log_file_name, __pyx_kp_s__2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __pyx_t_7 = PyNumber_Add(__pyx_v_self->_modelid, __pyx_kp_s_log_txt); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = __pyx_t_7;
    __pyx_t_7 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_log_file_name);
    __pyx_t_10 = __pyx_v_log_file_name;
  }
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fmu_log_name = __pyx_t_3;
  __pyx_t_3 = 0;

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

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

  /* "pyfmi\fmi.pyx":662
 * 
 *         #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_3 = __Pyx_PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __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 = 662; __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_INCREF(__pyx_n_s_w);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_w);
    __Pyx_GIVEREF(__pyx_n_s_w);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_10) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /*try:*/ {
      {
        __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
        __Pyx_XGOTREF(__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_16);
        __Pyx_XGOTREF(__pyx_t_17);
        /*try:*/ {
          __pyx_v_file = __pyx_t_6;
          __pyx_t_6 = 0;

          /* "pyfmi\fmi.pyx":663
 *         #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_6 = __pyx_v_self->_log;
          __Pyx_INCREF(__pyx_t_6);
          if (unlikely(__pyx_t_6 == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          }
          __pyx_t_9 = PyList_GET_SIZE(__pyx_t_6); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_9; __pyx_t_18+=1) {
            __pyx_v_i = __pyx_t_18;

            /* "pyfmi\fmi.pyx":664
 *         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 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            __Pyx_GOTREF(__pyx_t_3);
            if (unlikely(__pyx_v_self->_log == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            }
            __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->_log, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;};
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;};
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(__pyx_v_self->_log == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            }
            __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->_log, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;};
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;};
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(__pyx_v_self->_log == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            }
            __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->_log, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;};
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;};
            __Pyx_GOTREF(__pyx_t_8);
            __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 = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            __Pyx_GOTREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_10);
            PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_8);
            __pyx_t_10 = 0;
            __pyx_t_7 = 0;
            __pyx_t_8 = 0;
            __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_FMIL_module_s_log_level_d_s, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            if (!__pyx_t_1) {
              __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_GOTREF(__pyx_t_6);
            } else {
              __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
              __Pyx_GOTREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
              PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_8);
              __Pyx_GIVEREF(__pyx_t_8);
              __pyx_t_8 = 0;
              __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }

          /* "pyfmi\fmi.pyx":665
 *             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 = 665; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_v_self->_log);
          __Pyx_DECREF(__pyx_v_self->_log);
          __pyx_v_self->_log = ((PyObject*)__pyx_t_6);
          __pyx_t_6 = 0;
        }
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        goto __pyx_L30_try_end;
        __pyx_L23_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "pyfmi\fmi.pyx":662
 * 
 *         #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_6, &__pyx_t_3, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_8, NULL);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          __Pyx_GOTREF(__pyx_t_19);
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          if (__pyx_t_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          __pyx_t_2 = ((!(__pyx_t_4 != 0)) != 0);
          if (__pyx_t_2) {
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_7);
            __Pyx_ErrRestore(__pyx_t_6, __pyx_t_3, __pyx_t_7);
            __pyx_t_6 = 0; __pyx_t_3 = 0; __pyx_t_7 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L24_exception_handled;
        }
        __pyx_L25_except_error:;
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
        goto __pyx_L1_error;
        __pyx_L24_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
        __pyx_L30_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_14) {
          __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__20, NULL);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        }
        goto __pyx_L22;
      }
      __pyx_L22:;
    }
    goto __pyx_L36;
    __pyx_L19_error:;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    goto __pyx_L1_error;
    __pyx_L36:;
  }

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

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __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_log_name);
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF(__pyx_v_enable_logging);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":668
 * 
 * 
 *     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;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_logger", 0);

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

    /* "pyfmi\fmi.pyx":670
 *     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 = __Pyx_PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __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 = 670; __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_INCREF(__pyx_n_s_a);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_a);
      __Pyx_GIVEREF(__pyx_n_s_a);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          /*try:*/ {
            __pyx_v_file = __pyx_t_5;
            __pyx_t_5 = 0;

            /* "pyfmi\fmi.pyx":671
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_module); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_log_level); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_10 = __Pyx_PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_6);
            PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_10);
            __pyx_t_3 = 0;
            __pyx_t_6 = 0;
            __pyx_t_10 = 0;
            __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_FMIL_module_s_log_level_d_s, __pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_11)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_11);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
              }
            }
            if (!__pyx_t_11) {
              __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_GOTREF(__pyx_t_5);
            } else {
              __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_6);
              PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
              PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_10);
              __Pyx_GIVEREF(__pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L15_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "pyfmi\fmi.pyx":670
 *     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_5, &__pyx_t_2, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_10 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (__pyx_t_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __pyx_t_13 = ((!(__pyx_t_1 != 0)) != 0);
            if (__pyx_t_13) {
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_XGIVEREF(__pyx_t_6);
              __Pyx_ErrRestore(__pyx_t_5, __pyx_t_2, __pyx_t_6);
              __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_6 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          __pyx_L15_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_4) {
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__21, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }
    goto __pyx_L3;
  }
  /*else*/ {

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

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

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3append_log_message(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3append_log_message(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_log_level = 0;
  PyObject *__pyx_v_message = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append_log_message (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_module,&__pyx_n_s_log_level,&__pyx_n_s_message,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_module)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_level)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("append_log_message", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("append_log_message", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append_log_message") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_module = values[0];
    __pyx_v_log_level = values[1];
    __pyx_v_message = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("append_log_message", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.append_log_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_2append_log_message(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_module, __pyx_v_log_level, __pyx_v_message);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_2append_log_message(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_log_level, PyObject *__pyx_v_message) {
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  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("append_log_message", 0);

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

    /* "pyfmi\fmi.pyx":677
 *     def append_log_message(self, module, log_level, message):
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:             # <<<<<<<<<<<<<<
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 */
    /*with:*/ {
      __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __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 = 677; __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_INCREF(__pyx_n_s_a);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_a);
      __Pyx_GIVEREF(__pyx_n_s_a);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); 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_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          /*try:*/ {
            __pyx_v_file = __pyx_t_5;
            __pyx_t_5 = 0;

            /* "pyfmi\fmi.pyx":678
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_v_module);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_module);
            __Pyx_GIVEREF(__pyx_v_module);
            __Pyx_INCREF(__pyx_v_log_level);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_log_level);
            __Pyx_GIVEREF(__pyx_v_log_level);
            __Pyx_INCREF(__pyx_v_message);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_message);
            __Pyx_GIVEREF(__pyx_v_message);
            __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_FMIL_module_s_log_level_d_s, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_3)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_3);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
              }
            }
            if (!__pyx_t_3) {
              __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_GOTREF(__pyx_t_5);
            } else {
              __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
              PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_6);
              __Pyx_GIVEREF(__pyx_t_6);
              __pyx_t_6 = 0;
              __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L15_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "pyfmi\fmi.pyx":677
 *     def append_log_message(self, module, log_level, message):
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:             # <<<<<<<<<<<<<<
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 */
          /*except:*/ {
            __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.append_log_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_6 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __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 (__pyx_t_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __pyx_t_12 = ((!(__pyx_t_1 != 0)) != 0);
            if (__pyx_t_12) {
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_XGIVEREF(__pyx_t_10);
              __Pyx_ErrRestore(__pyx_t_5, __pyx_t_2, __pyx_t_10);
              __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_10 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          __pyx_L15_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_4) {
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__22, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":680
 *                 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(__pyx_v_self->_log == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = PyList_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_v_module);
    PyList_SET_ITEM(__pyx_t_10, 0, __pyx_v_module);
    __Pyx_GIVEREF(__pyx_v_module);
    __Pyx_INCREF(__pyx_v_log_level);
    PyList_SET_ITEM(__pyx_t_10, 1, __pyx_v_log_level);
    __Pyx_GIVEREF(__pyx_v_log_level);
    __Pyx_INCREF(__pyx_v_message);
    PyList_SET_ITEM(__pyx_t_10, 2, __pyx_v_message);
    __Pyx_GIVEREF(__pyx_v_message);
    __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_self->_log, __pyx_t_10); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_L3:;

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

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.append_log_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_4get_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_v_log = NULL;
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  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("get_log", 0);

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

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

    /* "pyfmi\fmi.pyx":697
 *         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 = __Pyx_PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __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 = 697; __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_INCREF(__pyx_n_s_r);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_r);
      __Pyx_GIVEREF(__pyx_n_s_r);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __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_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      /*try:*/ {
        {
          __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          /*try:*/ {
            __pyx_v_file = __pyx_t_5;
            __pyx_t_5 = 0;

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

              /* "pyfmi\fmi.pyx":699
 *             with open(self._fmu_log_name,'r') as file:
 *                 while True:
 *                     line = file.readline()             # <<<<<<<<<<<<<<
 *                     if line == "":
 *                         break
 */
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_readline); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_3 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
                __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
                if (likely(__pyx_t_3)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                  __Pyx_INCREF(__pyx_t_3);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_1, function);
                }
              }
              if (__pyx_t_3) {
                __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              } else {
                __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              }
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_5);
              __pyx_t_5 = 0;

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

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

              /* "pyfmi\fmi.pyx":702
 *                     if line == "":
 *                         break
 *                     log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 *         return log
 * 
 */
              __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_log, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            }
            __pyx_L17_break:;
          }
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L15_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "pyfmi\fmi.pyx":697
 *         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_1, &__pyx_t_5, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __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 (__pyx_t_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __pyx_t_12 = ((!(__pyx_t_2 != 0)) != 0);
            if (__pyx_t_12) {
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_XGIVEREF(__pyx_t_3);
              __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_3);
              __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_3 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          __pyx_L15_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_4) {
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__25, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L22;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L22:;
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":703
 *                         break
 *                     log.append(line.strip("\n"))
 *         return log             # <<<<<<<<<<<<<<
 * 
 *     cpdef _internal_set_fmu_null(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_log);
  __pyx_r = __pyx_v_log;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.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":705
 *         return log
 * 
 *     cpdef _internal_set_fmu_null(self):             # <<<<<<<<<<<<<<
 *         """
 *         This methods is ONLY for testing purposes. It sets the internal
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_7_internal_set_fmu_null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase__internal_set_fmu_null(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  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("_internal_set_fmu_null", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_internal_set_fmu_null); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_7_internal_set_fmu_null)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__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":710
 *         fmu state to NULL
 *         """
 *         self._fmu = NULL             # <<<<<<<<<<<<<<
 * 
 *     def print_log(self):
 */
  __pyx_v_self->_fmu = NULL;

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

  /* function exit code */
  __pyx_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.FMUModelBase._internal_set_fmu_null", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_6_internal_set_fmu_null(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_internal_set_fmu_null", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_12FMUModelBase__internal_set_fmu_null(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_9print_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_8print_log[] = "\n        Prints the log information to the prompt.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_9print_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_log (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8print_log(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":717
 *         """
 *         cdef int N
 *         log = self.get_log()             # <<<<<<<<<<<<<<
 *         N = len(log)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_log); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_log = __pyx_t_1;
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":720
 *         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_5 = __pyx_v_N;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "pyfmi\fmi.pyx":721
 * 
 *         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_1 = __Pyx_GetItemInt(__pyx_v_log, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __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 = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

  /* function exit code */
  __pyx_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.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;
}

/* "pyfmi\fmi.pyx":724
 *             #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
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_11_convert_filter(PyObject *__pyx_v_self, PyObject *__pyx_v_expression); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_10_convert_filter[] = "\n        Convert a filter based on unix filename pattern matching to a\n        list of regular expressions.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_11_convert_filter(PyObject *__pyx_v_self, PyObject *__pyx_v_expression) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_convert_filter (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_convert_filter(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_expression));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

    /* "pyfmi\fmi.pyx":731
 *         regexp = []
 *         if isinstance(expression,str):
 *             regex = fnmatch.translate(expression)             # <<<<<<<<<<<<<<
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_fnmatch); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_translate); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_expression); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_expression);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_expression);
      __Pyx_GIVEREF(__pyx_v_expression);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_regex = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":732
 *         if isinstance(expression,str):
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]             # <<<<<<<<<<<<<<
 *         elif isinstance(expression,list):
 *             for i in expression:
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_regex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __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 = NULL;
      __Pyx_INCREF(__pyx_v_regex);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_regex);
      __Pyx_GIVEREF(__pyx_v_regex);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_regexp, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;
    goto __pyx_L3;
  }

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

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

      /* "pyfmi\fmi.pyx":735
 *         elif isinstance(expression,list):
 *             for i in expression:
 *                 regex = fnmatch.translate(i)             # <<<<<<<<<<<<<<
 *                 regexp.append(re.compile(regex))
 *         else:
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_fnmatch); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_translate); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_regex, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":736
 *             for i in expression:
 *                 regex = fnmatch.translate(i)
 *                 regexp.append(re.compile(regex))             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("Unknown input.")
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_regex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __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 = NULL;
        __Pyx_INCREF(__pyx_v_regex);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_regex);
        __Pyx_GIVEREF(__pyx_v_regex);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_regexp, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":734
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):
 *             for i in expression:             # <<<<<<<<<<<<<<
 *                 regex = fnmatch.translate(i)
 *                 regexp.append(re.compile(regex))
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":738
 *                 regexp.append(re.compile(regex))
 *         else:
 *             raise FMUException("Unknown input.")             # <<<<<<<<<<<<<<
 *         return regexp
 * 
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __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 = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

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

  /* "pyfmi\fmi.pyx":724
 *             #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
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_get_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  char *__pyx_v_version;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_version", 0);

  /* "pyfmi\fmi.pyx":754
 *             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":755
 *         """
 *         version = FMIL.fmi1_import_get_version(self._fmu)
 *         return version             # <<<<<<<<<<<<<<
 * 
 *     version = property(fget=_get_version)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_14get_ode_sizes(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_ode_sizes", 0);

  /* "pyfmi\fmi.pyx":776
 *             [nCont, nEvent] = model.get_ode_sizes()
 *         """
 *         return self._nContinuousStates, self._nEventIndicators             # <<<<<<<<<<<<<<
 * 
 *     def get_real(self, valueref):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_nContinuousStates); 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_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_nEventIndicators); 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_3 = PyTuple_New(2); 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);
  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 = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_16get_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_val_ref = 0;
  PyArrayObject *__pyx_v_val = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val;
  __Pyx_Buffer __pyx_pybuffer_val;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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":800
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __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 = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__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 = 800; __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_7 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":802
 *         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_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
      __Pyx_INCREF(__pyx_float_0_0);
      PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_float_0_0);
      __Pyx_GIVEREF(__pyx_float_0_0);
    }
  }
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __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_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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 = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__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 = 802; __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_9 = 0;
  __pyx_v_val = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

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

    /* "pyfmi\fmi.pyx":808
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __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 = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

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

  /* function exit code */
  __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_6);
  { 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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_18set_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_val_ref = 0;
  PyArrayObject *__pyx_v_val = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val;
  __Pyx_Buffer __pyx_pybuffer_val;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  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_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":832
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __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 = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__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 = 832; __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_7 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":833
 *         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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__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 = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __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 = 833; __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_1);
  __pyx_t_1 = 0;

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

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

    /* "pyfmi\fmi.pyx":837
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __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 = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

    /* "pyfmi\fmi.pyx":843
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); 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_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__29, NULL); 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_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 = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* function exit code */
  __pyx_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_6);
  { 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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_20get_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_val_ref = 0;
  PyArrayObject *__pyx_v_val = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val;
  __Pyx_Buffer __pyx_pybuffer_val;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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":867
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __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 = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__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 = 867; __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_7 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":870
 * 
 *         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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  { 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_1, __pyx_temp, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
    }
  }
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __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_6); __pyx_t_6 = 0;
  __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 = 870; __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_val.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__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 = 870; __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_9 = 0;
  __pyx_v_val = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

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

    /* "pyfmi\fmi.pyx":875
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __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 = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

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

  /* function exit code */
  __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_6);
  { 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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_22set_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_val_ref = 0;
  PyArrayObject *__pyx_v_val = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val;
  __Pyx_Buffer __pyx_pybuffer_val;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  size_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_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":899
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __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 = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__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 = 899; __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_7 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":900
 *         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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_int); 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);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_2); 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_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__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 = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __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 = 900; __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_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":902
 *         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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_val_ref), __pyx_n_s_size); 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_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_nref = __pyx_t_9;

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

    /* "pyfmi\fmi.pyx":905
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __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 = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

    /* "pyfmi\fmi.pyx":911
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __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 = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* function exit code */
  __pyx_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_6);
  { 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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24get_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_val_ref = 0;
  void *__pyx_v_val;
  PyObject *__pyx_v_return_values = NULL;
  size_t __pyx_v_i;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  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_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":936
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_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 = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__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 = 936; __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_7 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":938
 *         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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_val_ref), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":940
 *         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":944
 * 
 *         #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":946
 *         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_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_return_values = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":947
 * 
 *         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_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":948
 *         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_1 = __Pyx_PyBool_FromLong(((((fmi1_boolean_t *)__pyx_v_val)[__pyx_v_i]) == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_return_values, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

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

    /* "pyfmi\fmi.pyx":957
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         return N.array(return_values)
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __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 = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":959
 *             raise FMUException('Failed to get the Boolean values.')
 * 
 *         return N.array(return_values)             # <<<<<<<<<<<<<<
 *         #return val==FMI_TRUE
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_return_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __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 = NULL;
    __Pyx_INCREF(__pyx_v_return_values);
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_return_values);
    __Pyx_GIVEREF(__pyx_v_return_values);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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_6);
  { 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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_26set_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_val_ref = 0;
  void *__pyx_v_val;
  size_t __pyx_v_i;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_t_10;
  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":983
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __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 = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__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 = 983; __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_7 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":984
 * 
 *         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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_val_ref), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":987
 * 
 *         #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":989
 *         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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":990
 * 
 *         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":991
 *         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_1 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_i, size_t, 0, __Pyx_PyInt_From_size_t, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":993
 *             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":996
 *             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":998
 *                 (<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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_val_ref), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":999
 * 
 *         if val_ref.size != values.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __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 = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1003
 * 
 *         #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":1005
 *         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":1007
 *         FMIL.free(val)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Boolean values.')
 * 
 */
  __pyx_t_10 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":1008
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __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 = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* function exit code */
  __pyx_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_6);
  { 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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_28get_string(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_string", 0);

  /* "pyfmi\fmi.pyx":1030
 *         Calls the low-level FMI function: fmiGetString
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef FMIL.size_t nref
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1047
 *         return N.array(temp)[:]
 * 
 *     def set_string(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the string-values in the FMU as defined by the valuereference(s).
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_30set_string(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_valueref, CYTHON_UNUSED PyObject *__pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_string", 0);

  /* "pyfmi\fmi.pyx":1065
 *         Calls the low-level FMI function: fmiSetString
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef FMIL.size_t nref
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":1047
 *         return N.array(temp)[:]
 * 
 *     def set_string(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the string-values in the FMU as defined by the valuereference(s).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_32set_debug_logging(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_flag) {
  fmi1_boolean_t __pyx_v_log;
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_debug_logging", 0);

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

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

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

  /* "pyfmi\fmi.pyx":1112
 *             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":1113
 * 
 *         status = FMIL.fmi1_import_set_debug_logging(self._fmu, log)
 *         self._enable_logging = bool(log)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_t_2 = __Pyx_PyInt_From_fmi1_boolean_t(__pyx_v_log); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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 = 1113; __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 = 1113; __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":1115
 *         self._enable_logging = bool(log)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the debugging option.')
 * 
 */
  __pyx_t_1 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1116
 * 
 *         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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__36, NULL); 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_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 = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":1118
 *             raise FMUException('Failed to set the debugging option.')
 * 
 *     def set_log_level(self, FMIL.jm_log_level_enu_t level):             # <<<<<<<<<<<<<<
 *         """
 *         Specifies the log level for PyFMI. Note that this is
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35set_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_34set_log_level[] = "\n        Specifies the log level for PyFMI. Note that this is\n        different from the FMU logging which is specified via\n        set_debug_logging.\n\n        Parameters::\n\n            level --\n                The log level. Available values:\n                    NOTHING = 0\n                    FATAL = 1\n                    ERROR = 2\n                    WARNING = 3\n                    INFO = 4\n                    VERBOSE = 5\n                    DEBUG = 6\n                    ALL = 7\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35set_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level) {
  jm_log_level_enu_t __pyx_v_level;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  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 = 1118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_log_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_34set_log_level(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((jm_log_level_enu_t)__pyx_v_level));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_34set_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, jm_log_level_enu_t __pyx_v_level) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  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("set_log_level", 0);

  /* "pyfmi\fmi.pyx":1137
 *                     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_2 = ((__pyx_v_level < jm_log_level_nothing) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_level > jm_log_level_all) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1138
 *         """
 *         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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __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 = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":1118
 *             raise FMUException('Failed to set the debugging option.')
 * 
 *     def set_log_level(self, FMIL.jm_log_level_enu_t level):             # <<<<<<<<<<<<<<
 *         """
 *         Specifies the log level for PyFMI. Note that this is
 */

  /* function exit code */
  __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.FMUModelBase.set_log_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1141
 *         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)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level) {
  jm_log_level_enu_t __pyx_v_level;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  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 = 1141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_fmil_log_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_36set_fmil_log_level(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((jm_log_level_enu_t)__pyx_v_level));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_36set_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, jm_log_level_enu_t __pyx_v_level) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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_fmil_log_level", 0);

  /* "pyfmi\fmi.pyx":1142
 * 
 *     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_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __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_PyObject_Call(__pyx_t_2, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __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":1143
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):
 *         logging.warning("The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.")
 *         self.set_log_level(level)             # <<<<<<<<<<<<<<
 * 
 *     def _set(self, variable_name, value):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_log_level); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromLong(__pyx_v_level); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __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 = NULL;
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1141
 *         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)
 */

  /* function exit code */
  __pyx_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_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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":1154
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); 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_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); 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);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

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

    /* "pyfmi\fmi.pyx":1159
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variable_name)             # <<<<<<<<<<<<<<
 * 
 *         ref =  FMIL.fmi1_import_get_variable_vr(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_v_variable_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_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 = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1161
 *             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":1162
 * 
 *         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":1163
 *         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":1175
 *         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
 */
  switch (__pyx_v_type) {

    /* "pyfmi\fmi.pyx":1165
 *         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
 */
    case fmi1_base_type_real:

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

      /* "pyfmi\fmi.pyx":1167
 *         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_7 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_7);
      __pyx_t_7 = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "pyfmi\fmi.pyx":1168
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_real); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_3 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_3) {
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    break;

    /* "pyfmi\fmi.pyx":1169
 *                 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
 */
    case fmi1_base_type_int:
    case fmi1_base_type_enum:

    /* "pyfmi\fmi.pyx":1170
 *             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_7 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_7, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_6) {

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

    /* "pyfmi\fmi.pyx":1172
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_integer); 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);
    __pyx_t_7 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyList_New(1); 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);
    PyList_SET_ITEM(__pyx_t_1, 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 = 1172; __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_4 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_3 = PyTuple_New(2+__pyx_t_8); 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);
    if (__pyx_t_4) {
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_1 = 0;
    __pyx_t_7 = 0;
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    break;

    /* "pyfmi\fmi.pyx":1173
 *                 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
 */
    case fmi1_base_type_str:

    /* "pyfmi\fmi.pyx":1174
 *             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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyList_SET_ITEM(__pyx_t_7, 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 = 1174; __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_1 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_1) {
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_7 = 0;
    __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    break;

    /* "pyfmi\fmi.pyx":1175
 *         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
 */
    case fmi1_base_type_bool:

    /* "pyfmi\fmi.pyx":1176
 *             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_9 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_9, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":1177
 *         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_6 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pyfmi\fmi.pyx":1178
 *             if alias_kind == FMI_NEGATED_ALIAS:
 *                 value = not value
 *             self.set_boolean([ref], [value])             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Type not supported.')
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_boolean); 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_t_9 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = PyList_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);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_9, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_1 = PyTuple_New(2+__pyx_t_8); 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 (__pyx_t_7) {
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_8, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_3 = 0;
    __pyx_t_9 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __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_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    break;
    default:

    /* "pyfmi\fmi.pyx":1180
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

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

  /* function exit code */
  __pyx_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_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":1192
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

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

    /* "pyfmi\fmi.pyx":1197
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variable_name)             # <<<<<<<<<<<<<<
 * 
 *         ref =  FMIL.fmi1_import_get_variable_vr(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_v_variable_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_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 = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1199
 *             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":1200
 * 
 *         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":1201
 *         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":1211
 *         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
 */
  switch (__pyx_v_type) {

    /* "pyfmi\fmi.pyx":1203
 *         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
 */
    case fmi1_base_type_real:

    /* "pyfmi\fmi.pyx":1204
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 *             value = self.get_real([ref])             # <<<<<<<<<<<<<<
 *             return -1*value if alias_kind == FMI_NEGATED_ALIAS else value
 *         elif type == FMIL.fmi1_base_type_int or type == FMIL.fmi1_base_type_enum: #INTEGER
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_real); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __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 = 1204; __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 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_value = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":1205
 *         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_2 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_6) {
      __pyx_t_4 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __pyx_t_4;
      __pyx_t_4 = 0;
    } else {
      __Pyx_INCREF(__pyx_v_value);
      __pyx_t_1 = __pyx_v_value;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":1206
 *             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
 */
    case fmi1_base_type_int:
    case fmi1_base_type_enum:

    /* "pyfmi\fmi.pyx":1207
 *             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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __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 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_value = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":1208
 *         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_4 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {
      __pyx_t_2 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __pyx_t_2;
      __pyx_t_2 = 0;
    } else {
      __Pyx_INCREF(__pyx_v_value);
      __pyx_t_1 = __pyx_v_value;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":1209
 *             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
 */
    case fmi1_base_type_str:

    /* "pyfmi\fmi.pyx":1210
 *             return -1*value if alias_kind == FMI_NEGATED_ALIAS else value
 *         elif type == FMIL.fmi1_base_type_str: #STRING
 *             return self.get_string([ref])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN
 *             value = self.get_boolean([ref])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __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 = 1210; __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 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":1211
 *         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
 */
    case fmi1_base_type_bool:

    /* "pyfmi\fmi.pyx":1212
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_boolean); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __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 = 1212; __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 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_value = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":1213
 *         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_2 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_6) {
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __pyx_t_4;
      __pyx_t_4 = 0;
    } else {
      __Pyx_INCREF(__pyx_v_value);
      __pyx_t_1 = __pyx_v_value;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
    default:

    /* "pyfmi\fmi.pyx":1215
 *             return not value if alias_kind == FMI_NEGATED_ALIAS else value
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_description(self, variable_name):
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __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 = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

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

  /* function exit code */
  __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_7);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  char *__pyx_v_desc;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_description", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_description); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_description)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __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_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":1233
 *         cdef char* desc
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":1237
 * 
 *         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_7 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":1238
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         desc = FMIL.fmi1_import_get_variable_description(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1240
 *             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":1242
 *         desc = FMIL.fmi1_import_get_variable_description(variable)
 * 
 *         return desc if desc != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_base_type_enu_t get_variable_data_type(self, variable_name) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_desc != NULL) != 0)) {
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_desc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_s__2);
    __pyx_t_1 = __pyx_kp_s__2;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_42get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_description", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_description(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":1244
 *         return desc if desc != NULL else ""
 * 
 *     cpdef FMIL.fmi1_base_type_enu_t get_variable_data_type(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get data type of variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static enum fmi1_base_type_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_base_type_enu_t __pyx_v_type;
  char *__pyx_v_variablename;
  enum fmi1_base_type_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  enum fmi1_base_type_enu_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_data_type", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_data_type); 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);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_data_type)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __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_3); __pyx_t_3 = 0;
      __pyx_t_6 = ((enum fmi1_base_type_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1260
 *         cdef FMIL.fmi1_base_type_enu_t type
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __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_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":1264
 * 
 *         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_8 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":1265
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1267
 *             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":1269
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 *         return type             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_value_reference_t get_variable_valueref(self, variable_name) except *:
 */
  __pyx_r = __pyx_v_type;
  goto __pyx_L0;

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_data_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_44get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fmi1_base_type_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_data_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_data_type(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __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 = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":1271
 *         return type
 * 
 *     cpdef FMIL.fmi1_value_reference_t get_variable_valueref(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Extract the ValueReference given a variable name.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static fmi1_value_reference_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_value_reference_t __pyx_v_vr;
  char *__pyx_v_variablename;
  fmi1_value_reference_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  fmi1_value_reference_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_valueref", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_valueref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_valueref)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __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_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_fmi1_value_reference_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (fmi1_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1287
 *         cdef FMIL.fmi1_value_reference_t vr
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __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_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":1291
 * 
 *         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_8 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":1292
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         vr =  FMIL.fmi1_import_get_variable_vr(variable)
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); 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_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); 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);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_46get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi1_value_reference_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_valueref", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_valueref(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":1297
 *         return vr
 * 
 *     def get_variable_nominal(self, variablename=None, valueref=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the nominal value from a real variable determined by
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_48get_variable_nominal[] = "\n        Returns the nominal value from a real variable determined by\n        either its value reference or its variable name.\n\n        Parameters::\n\n            valueref --\n                The value reference of the variable.\n            variablename --\n                The name of the variable.\n\n        Returns::\n\n            The nominal value of the given variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variablename = 0;
  PyObject *__pyx_v_valueref = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_nominal (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_variablename,&__pyx_n_s_valueref,0};
    PyObject* values[2] = {0,0};
    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 = 1297; __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 = 1297; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_nominal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_variable_nominal(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_variablename, __pyx_v_valueref);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_variable_nominal(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  char *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_nominal", 0);

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

    /* "pyfmi\fmi.pyx":1317
 * 
 *         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_As_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 = 1317; __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":1318
 *         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) != 0);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":1319
 *             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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __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 = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_valueref);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_valueref);
      __Pyx_GIVEREF(__pyx_v_valueref);
      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_with_value_referenc, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":1320
 *             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_1 = PyObject_RichCompare(__pyx_v_variablename, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":1321
 *                 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_8 = __Pyx_PyObject_AsString(__pyx_v_variablename); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_t_8);

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

      /* "pyfmi\fmi.pyx":1323
 *             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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_v_variablename); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, 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_6); __pyx_t_6 = 0;
      }
      __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 = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L3;
  }
  /*else*/ {

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

  /* "pyfmi\fmi.pyx":1327
 *             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":1328
 * 
 *         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) != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":1329
 *         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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_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 = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":1297
 *         return vr
 * 
 *     def get_variable_nominal(self, variablename=None, valueref=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the nominal value from a real variable determined by
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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":1333
 *         return  FMIL.fmi1_import_get_real_variable_nominal(real_variable)
 * 
 *     cpdef get_variable_fixed(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns if the start value is fixed (True - The value is used as
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51get_variable_fixed(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  char *__pyx_v_variablename;
  int __pyx_v_status;
  int __pyx_v_fixed;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_fixed", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_fixed); 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);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51get_variable_fixed)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__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":1350
 *         cdef FMIL.fmi1_import_variable_t *variable
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); 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_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); 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);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":1354
 * 
 *         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_7 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":1355
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_variable_has_start(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1357
 *             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":1359
 *         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_7 = ((__pyx_v_status == 0) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":1360
 * 
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_does_not_have_a_s, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __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_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_fixed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_50get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_fixed", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_fixed(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":1367
 * 
 * 
 *     cpdef get_variable_start(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the start value for the variable or else raises
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_integer_variable_t *__pyx_v_int_variable;
  fmi1_import_real_variable_t *__pyx_v_real_variable;
  fmi1_import_bool_variable_t *__pyx_v_bool_variable;
  fmi1_import_enum_variable_t *__pyx_v_enum_variable;
  fmi1_import_string_variable_t *__pyx_v_str_variable;
  enum fmi1_base_type_enu_t __pyx_v_type;
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_FMITRUE;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_start", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_variable_start)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __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_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":1389
 *         cdef FMIL.fmi1_base_type_enu_t type
 *         cdef int status
 *         cdef FMIL.fmi1_boolean_t FMITRUE = 1             # <<<<<<<<<<<<<<
 * 
 *         variable_name = encode(variable_name)
 */
  __pyx_v_FMITRUE = 1;

  /* "pyfmi\fmi.pyx":1391
 *         cdef FMIL.fmi1_boolean_t FMITRUE = 1
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __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_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

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

    /* "pyfmi\fmi.pyx":1396
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_variable_has_start(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1398
 *             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":1400
 *         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_7 = ((__pyx_v_status == 0) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":1401
 * 
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_does_not_have_a_s, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __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_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1403
 *             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":1421
 *             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)
 */
  switch (__pyx_v_type) {

    /* "pyfmi\fmi.pyx":1405
 *         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)
 */
    case fmi1_base_type_real:

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

    /* "pyfmi\fmi.pyx":1409
 *             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)
 */
    case fmi1_base_type_int:

    /* "pyfmi\fmi.pyx":1410
 * 
 *         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":1411
 *         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 = __Pyx_PyInt_From_int(fmi1_import_get_integer_variable_start(__pyx_v_int_variable)); 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_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":1413
 *             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
 */
    case fmi1_base_type_bool:

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

    /* "pyfmi\fmi.pyx":1417
 *             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)
 */
    case fmi1_base_type_enum:

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

    /* "pyfmi\fmi.pyx":1421
 *             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)
 */
    case fmi1_base_type_str:

    /* "pyfmi\fmi.pyx":1422
 * 
 *         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":1423
 *         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 = __Pyx_PyBytes_FromString(fmi1_import_get_string_variable_start(__pyx_v_str_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
    default:

    /* "pyfmi\fmi.pyx":1426
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self, variable_name):
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_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 = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_52get_variable_start[] = "\n        Returns the start value for the variable or else raises\n        FMUException.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable\n\n        Returns::\n\n            The start value.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_start (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_variable_start(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_start(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":1428
 *             raise FMUException("Unknown variable type.")
 * 
 *     cpdef get_variable_max(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the maximum value for the given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_integer_variable_t *__pyx_v_int_variable;
  fmi1_import_real_variable_t *__pyx_v_real_variable;
  fmi1_import_enum_variable_t *__pyx_v_enum_variable;
  enum fmi1_base_type_enu_t __pyx_v_type;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_max", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_max)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); 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);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, 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_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__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":1447
 *         cdef FMIL.fmi1_base_type_enu_t type
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __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_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":1451
 * 
 *         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_7 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":1452
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1454
 *             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":1464
 *             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)
 */
  switch (__pyx_v_type) {

    /* "pyfmi\fmi.pyx":1456
 *         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)
 */
    case fmi1_base_type_real:

    /* "pyfmi\fmi.pyx":1457
 * 
 *         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":1458
 *         if type == FMIL.fmi1_base_type_real:
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *             return FMIL.fmi1_import_get_real_variable_max(real_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_int:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(fmi1_import_get_real_variable_max(__pyx_v_real_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":1460
 *             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)
 */
    case fmi1_base_type_int:

    /* "pyfmi\fmi.pyx":1461
 * 
 *         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":1462
 *         elif type == FMIL.fmi1_base_type_int:
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)
 *             return FMIL.fmi1_import_get_integer_variable_max(int_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_enum:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_int(fmi1_import_get_integer_variable_max(__pyx_v_int_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":1464
 *             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)
 */
    case fmi1_base_type_enum:

    /* "pyfmi\fmi.pyx":1465
 * 
 *         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":1466
 *         elif type == FMIL.fmi1_base_type_enum:
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)
 *             return FMIL.fmi1_import_get_enum_variable_max(enum_variable)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_int(fmi1_import_get_enum_variable_max(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
    default:

    /* "pyfmi\fmi.pyx":1469
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self, variable_name):
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __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 = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_54get_variable_max[] = "\n        Returns the maximum value for the given variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The maximum value for the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_max (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_max(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_max", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_max(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":1471
 *             raise FMUException("The variable type does not have a maximum value.")
 * 
 *     cpdef get_variable_min(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the minimum value for the given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_integer_variable_t *__pyx_v_int_variable;
  fmi1_import_real_variable_t *__pyx_v_real_variable;
  fmi1_import_enum_variable_t *__pyx_v_enum_variable;
  enum fmi1_base_type_enu_t __pyx_v_type;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_min", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_min)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __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_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":1490
 *         cdef FMIL.fmi1_base_type_enu_t type
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); 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);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":1494
 * 
 *         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_7 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":1495
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1497
 *             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":1507
 *             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)
 */
  switch (__pyx_v_type) {

    /* "pyfmi\fmi.pyx":1499
 *         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)
 */
    case fmi1_base_type_real:

    /* "pyfmi\fmi.pyx":1500
 * 
 *         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":1501
 *         if type == FMIL.fmi1_base_type_real:
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *             return FMIL.fmi1_import_get_real_variable_min(real_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_int:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(fmi1_import_get_real_variable_min(__pyx_v_real_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":1503
 *             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)
 */
    case fmi1_base_type_int:

    /* "pyfmi\fmi.pyx":1504
 * 
 *         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":1505
 *         elif type == FMIL.fmi1_base_type_int:
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)
 *             return FMIL.fmi1_import_get_integer_variable_min(int_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_enum:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_int(fmi1_import_get_integer_variable_min(__pyx_v_int_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":1507
 *             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)
 */
    case fmi1_base_type_enum:

    /* "pyfmi\fmi.pyx":1508
 * 
 *         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":1509
 *         elif type == FMIL.fmi1_base_type_enum:
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)
 *             return FMIL.fmi1_import_get_enum_variable_min(enum_variable)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_int(fmi1_import_get_enum_variable_min(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
    default:

    /* "pyfmi\fmi.pyx":1512
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __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 = 1512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_56get_variable_min[] = "\n        Returns the minimum value for the given variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The minimum value for the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_min (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_56get_variable_min(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_56get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_min", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_min(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":1515
 * 
 * 
 *     def get_model_variables(self,type=None, include_alias=True,             # <<<<<<<<<<<<<<
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_59get_model_variables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_58get_model_variables[] = "\n        Extract the names of the variables in a model.\n\n        Parameters::\n\n            type --\n                The type of the variables (Real==0, Int==1, Bool=2,\n                String==3, Enumeration==4). Default None (i.e all).\n            include_alias --\n                If alias should be included or not. Default True\n            causality --\n                The causality of the variables (Input==0, Output==1,\n                Internal==2, None==3). Default None (i.e all).\n            variability --\n                The variability of the variables (Constant==0,\n                Parameter==1, Discrete==2, Continuous==3). Default None\n                (i.e. all)\n            only_start --\n                If only variables that has a start value should be\n                returned. Default False\n            only_fixed --\n                If only variables that has a start value that is fixed\n                should be returned. Default False\n            filter --\n                Filter the variables using a unix filename pattern\n                matching (filter=\"*der*\"). Can also be a list of filters\n                See http://docs.python.org/2/library/fnmatch.html.\n                Default None\n\n        Returns::\n\n            Dict with variable name as key and a ScalarVariable class as\n            value.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_59get_model_variables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_include_alias = 0;
  PyObject *__pyx_v_causality = 0;
  PyObject *__pyx_v_variability = 0;
  PyObject *__pyx_v_only_start = 0;
  PyObject *__pyx_v_only_fixed = 0;
  PyObject *__pyx_v_filter = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_variables (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_include_alias,&__pyx_n_s_causality,&__pyx_n_s_variability,&__pyx_n_s_only_start,&__pyx_n_s_only_fixed,&__pyx_n_s_filter,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_True);

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

    /* "pyfmi\fmi.pyx":1517
 *     def get_model_variables(self,type=None, include_alias=True,
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False,             # <<<<<<<<<<<<<<
 *                             filter=None):
 *         """
 */
    values[4] = ((PyObject *)Py_False);
    values[5] = ((PyObject *)Py_False);

    /* "pyfmi\fmi.pyx":1518
 *                             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 = 1515; __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 = 1515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_model_variables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_58get_model_variables(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_type, __pyx_v_include_alias, __pyx_v_causality, __pyx_v_variability, __pyx_v_only_start, __pyx_v_only_fixed, __pyx_v_filter);

  /* "pyfmi\fmi.pyx":1515
 * 
 * 
 *     def get_model_variables(self,type=None, include_alias=True,             # <<<<<<<<<<<<<<
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False,
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_58get_model_variables(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_include_alias, PyObject *__pyx_v_causality, PyObject *__pyx_v_variability, PyObject *__pyx_v_only_start, PyObject *__pyx_v_only_fixed, PyObject *__pyx_v_filter) {
  fmi1_import_variable_t *__pyx_v_variable;
  struct fmi1_import_variable_list_t *__pyx_v_variable_list;
  size_t __pyx_v_variable_list_size;
  fmi1_value_reference_t __pyx_v_value_ref;
  enum fmi1_base_type_enu_t __pyx_v_data_type;
  enum fmi1_base_type_enu_t __pyx_v_target_type;
  enum fmi1_variability_enu_t __pyx_v_data_variability;
  enum fmi1_variability_enu_t __pyx_v_target_variability;
  enum fmi1_causality_enu_t __pyx_v_data_causality;
  enum fmi1_causality_enu_t __pyx_v_target_causality;
  enum fmi1_variable_alias_kind_enu_t __pyx_v_alias_kind;
  char *__pyx_v_desc;
  PyObject *__pyx_v_variable_dict = 0;
  PyObject *__pyx_v_filter_list = 0;
  int __pyx_v_selected_type;
  int __pyx_v_selected_variability;
  int __pyx_v_selected_causality;
  int __pyx_v_has_start;
  int __pyx_v_is_fixed;
  int __pyx_v_selected_filter;
  int __pyx_v_length_filter;
  size_t __pyx_v_i;
  PyObject *__pyx_v_name = NULL;
  int __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __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;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  size_t __pyx_t_11;
  size_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_model_variables", 0);

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

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

  /* "pyfmi\fmi.pyx":1564
 *         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":1565
 *         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":1566
 *         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":1568
 *         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 = 1568; __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":1569
 *         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":1571
 *         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":1572
 * 
 *         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":1574
 *         variable_list_size = FMIL.fmi1_import_get_variable_list_size(variable_list)
 * 
 *         if type!=None: #A type have has been selected             # <<<<<<<<<<<<<<
 *             target_type = type
 *             selected_type = 1
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_type, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

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

    /* "pyfmi\fmi.pyx":1576
 *         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":1577
 *             target_type = type
 *             selected_type = 1
 *         if causality!=None: #A causality has been selected             # <<<<<<<<<<<<<<
 *             target_causality = causality
 *             selected_causality = 1
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_causality, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

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

    /* "pyfmi\fmi.pyx":1579
 *         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":1580
 *             target_causality = causality
 *             selected_causality = 1
 *         if variability!=None: #A variability has been selected             # <<<<<<<<<<<<<<
 *             target_variability = variability
 *             selected_variability = 1
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_variability, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

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

    /* "pyfmi\fmi.pyx":1582
 *         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":1583
 *             target_variability = variability
 *             selected_variability = 1
 *         if selected_filter:             # <<<<<<<<<<<<<<
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)
 */
  __pyx_t_3 = (__pyx_v_selected_filter != 0);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1584
 *             selected_variability = 1
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)             # <<<<<<<<<<<<<<
 *             length_filter = len(filter_list)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert_filter); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_filter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_v_filter);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_filter);
      __Pyx_GIVEREF(__pyx_v_filter);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF_SET(__pyx_v_filter_list, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":1585
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
    if (unlikely(__pyx_v_filter_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = PyList_GET_SIZE(__pyx_v_filter_list); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_length_filter = __pyx_t_10;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":1587
 *             length_filter = len(filter_list)
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)
 */
  __pyx_t_11 = __pyx_v_variable_list_size;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pyfmi\fmi.pyx":1589
 *         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":1591
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)
 */
    __pyx_v_alias_kind = fmi1_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1592
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyBytes_FromString(fmi1_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
      PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":1593
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 *             has_start  = FMIL.fmi1_import_get_variable_has_start(variable)
 */
    __pyx_v_value_ref = fmi1_import_get_variable_vr(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1594
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 *             has_start  = FMIL.fmi1_import_get_variable_has_start(variable)
 *             data_variability = FMIL.fmi1_import_get_variability(variable)
 */
    __pyx_v_data_type = fmi1_import_get_variable_base_type(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1595
 *             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":1596
 *             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":1597
 *             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":1598
 *             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":1601
 * 
 *             #If only variables with start are wanted, check if the variable has start
 *             if only_start and has_start != 1:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_only_start); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_14) {
    } else {
      __pyx_t_3 = __pyx_t_14;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_14 = ((__pyx_v_has_start != 1) != 0);
    __pyx_t_3 = __pyx_t_14;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1602
 *             #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;
    }

    /* "pyfmi\fmi.pyx":1604
 *                 continue
 * 
 *             if only_fixed:             # <<<<<<<<<<<<<<
 *                 if has_start!=1:
 *                     continue
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_only_fixed); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

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

        /* "pyfmi\fmi.pyx":1606
 *             if only_fixed:
 *                 if has_start!=1:
 *                     continue             # <<<<<<<<<<<<<<
 *                 else:
 *                     is_fixed = FMIL.fmi1_import_get_variable_is_fixed(variable)
 */
        goto __pyx_L7_continue;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":1608
 *                     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":1609
 *                 else:
 *                     is_fixed = FMIL.fmi1_import_get_variable_is_fixed(variable)
 *                     if is_fixed !=1:             # <<<<<<<<<<<<<<
 *                         continue
 * 
 */
        __pyx_t_3 = ((__pyx_v_is_fixed != 1) != 0);
        if (__pyx_t_3) {

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

    /* "pyfmi\fmi.pyx":1612
 *                         continue
 * 
 *             if selected_type == 1 and data_type != target_type:             # <<<<<<<<<<<<<<
 *                 continue
 *             if selected_causality == 1 and data_causality != target_causality:
 */
    __pyx_t_14 = ((__pyx_v_selected_type == 1) != 0);
    if (__pyx_t_14) {
    } else {
      __pyx_t_3 = __pyx_t_14;
      goto __pyx_L16_bool_binop_done;
    }
    __pyx_t_14 = ((__pyx_v_data_type != __pyx_v_target_type) != 0);
    __pyx_t_3 = __pyx_t_14;
    __pyx_L16_bool_binop_done:;
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1613
 * 
 *             if selected_type == 1 and data_type != target_type:
 *                 continue             # <<<<<<<<<<<<<<
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue
 */
      goto __pyx_L7_continue;
    }

    /* "pyfmi\fmi.pyx":1614
 *             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_14 = ((__pyx_v_selected_causality == 1) != 0);
    if (__pyx_t_14) {
    } else {
      __pyx_t_3 = __pyx_t_14;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_14 = ((__pyx_v_data_causality != __pyx_v_target_causality) != 0);
    __pyx_t_3 = __pyx_t_14;
    __pyx_L19_bool_binop_done:;
    if (__pyx_t_3) {

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

    /* "pyfmi\fmi.pyx":1616
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue
 *             if selected_variability == 1 and data_variability != target_variability:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_14 = ((__pyx_v_selected_variability == 1) != 0);
    if (__pyx_t_14) {
    } else {
      __pyx_t_3 = __pyx_t_14;
      goto __pyx_L22_bool_binop_done;
    }
    __pyx_t_14 = ((__pyx_v_data_variability != __pyx_v_target_variability) != 0);
    __pyx_t_3 = __pyx_t_14;
    __pyx_L22_bool_binop_done:;
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1617
 *                 continue
 *             if selected_variability == 1 and data_variability != target_variability:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if selected_filter:
 */
      goto __pyx_L7_continue;
    }

    /* "pyfmi\fmi.pyx":1619
 *                 continue
 * 
 *             if selected_filter:             # <<<<<<<<<<<<<<
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):
 */
    __pyx_t_3 = (__pyx_v_selected_filter != 0);
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1620
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     if re.match(filter_list[j], name):
 *                         break
 */
      __pyx_t_2 = __pyx_v_length_filter;
      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_2; __pyx_t_15+=1) {
        __pyx_v_j = __pyx_t_15;

        /* "pyfmi\fmi.pyx":1621
 *             if selected_filter:
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_match); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(__pyx_v_filter_list == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_filter_list, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = NULL;
        __pyx_t_10 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
            __pyx_t_10 = 1;
          }
        }
        __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_9) {
          PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
        }
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_10, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        __pyx_t_7 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_3) {

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

        /* "pyfmi\fmi.pyx":1624
 *                         break
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if include_alias:
 */
        goto __pyx_L7_continue;
      }
      __pyx_L26_break:;
      goto __pyx_L24;
    }
    __pyx_L24:;

    /* "pyfmi\fmi.pyx":1626
 *                     continue
 * 
 *             if include_alias:             # <<<<<<<<<<<<<<
 *                 variable_dict[name] = ScalarVariable(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_include_alias); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1628
 *             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_1 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_13 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      if (((__pyx_v_desc != NULL) != 0)) {
        __pyx_t_7 = __Pyx_decode_c_string(__pyx_v_desc, 0, strlen(__pyx_v_desc), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __pyx_t_7;
        __pyx_t_7 = 0;
      } else {
        __Pyx_INCREF(__pyx_kp_s__2);
        __pyx_t_8 = __pyx_kp_s__2;
      }

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

      /* "pyfmi\fmi.pyx":1630
 *                                        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_16 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);

      /* "pyfmi\fmi.pyx":1627
 * 
 *             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_17 = PyTuple_New(7); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_INCREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_17, 6, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      __pyx_t_1 = 0;
      __pyx_t_13 = 0;
      __pyx_t_8 = 0;
      __pyx_t_7 = 0;
      __pyx_t_9 = 0;
      __pyx_t_16 = 0;
      __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable)), __pyx_t_17, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      if (unlikely(PyDict_SetItem(__pyx_v_variable_dict, __pyx_v_name, __pyx_t_16) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      goto __pyx_L28;
    }

    /* "pyfmi\fmi.pyx":1632
 *                                        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_3 = ((__pyx_v_alias_kind == fmi1_variable_is_not_alias) != 0);
    if (__pyx_t_3) {

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

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

      /* "pyfmi\fmi.pyx":1636
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 *                                        alias_kind)             # <<<<<<<<<<<<<<
 * 
 *         #Free the variable list
 */
      __pyx_t_13 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);

      /* "pyfmi\fmi.pyx":1633
 * 
 *             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 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      __pyx_t_16 = 0;
      __pyx_t_17 = 0;
      __pyx_t_9 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(PyDict_SetItem(__pyx_v_variable_dict, __pyx_v_name, __pyx_t_13) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L28;
    }
    __pyx_L28:;
    __pyx_L7_continue:;
  }

  /* "pyfmi\fmi.pyx":1639
 * 
 *         #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":1641
 *         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(__pyx_v_variable_dict);
  __pyx_r = __pyx_v_variable_dict;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":1515
 * 
 * 
 *     def get_model_variables(self,type=None, include_alias=True,             # <<<<<<<<<<<<<<
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_model_variables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XDECREF(__pyx_v_filter_list);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1643
 *         return variable_dict
 * 
 *     def get_model_time_varying_value_references(self, filter=None):             # <<<<<<<<<<<<<<
 *         """
 *         Extract the value references of the variables in a model
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_60get_model_time_varying_value_references[] = "\n        Extract the value references of the variables in a model\n        that are time-varying. This method is typically used to\n        retrieve the variables for which the result can be stored.\n\n        Parameters::\n\n            filter --\n                Filter the variables using a unix filename pattern\n                matching (filter=\"*der*\"). Can also be a list of filters\n                See http://docs.python.org/2/library/fnmatch.html.\n                Default None\n\n        Returns::\n\n            Three lists with the real, integer and boolean value-references\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filter = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_time_varying_value_references (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filter,0};
    PyObject* values[1] = {0};
    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 = 1643; __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 = 1643; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_model_time_varying_value_references", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_60get_model_time_varying_value_references(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_filter);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_60get_model_time_varying_value_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_filter) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_variable_t *__pyx_v_base_variable;
  struct fmi1_import_variable_list_t *__pyx_v_variable_list;
  size_t __pyx_v_variable_list_size;
  fmi1_value_reference_t __pyx_v_value_ref;
  enum fmi1_base_type_enu_t __pyx_v_data_type;
  enum fmi1_variability_enu_t __pyx_v_data_variability;
  enum fmi1_variable_alias_kind_enu_t __pyx_v_alias_kind;
  CYTHON_UNUSED PyObject *__pyx_v_variable_dict = 0;
  PyObject *__pyx_v_filter_list = 0;
  PyObject *__pyx_v_real_var_ref = 0;
  PyObject *__pyx_v_int_var_ref = 0;
  PyObject *__pyx_v_bool_var_ref = 0;
  CYTHON_UNUSED int __pyx_v_selected_variability;
  int __pyx_v_selected_filter;
  int __pyx_v_length_filter;
  size_t __pyx_v_i;
  PyObject *__pyx_v_name = NULL;
  int __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  size_t __pyx_t_8;
  size_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_model_time_varying_value_references", 0);

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

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

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

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

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

  /* "pyfmi\fmi.pyx":1673
 *         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":1674
 *         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 = 1674; __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":1675
 *         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":1677
 *         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":1678
 * 
 *         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":1680
 *         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)
 */
  __pyx_t_3 = (__pyx_v_selected_filter != 0);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1681
 * 
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)             # <<<<<<<<<<<<<<
 *             length_filter = len(filter_list)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert_filter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_filter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_filter);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_filter);
      __Pyx_GIVEREF(__pyx_v_filter);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF_SET(__pyx_v_filter_list, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":1682
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
    if (unlikely(__pyx_v_filter_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = PyList_GET_SIZE(__pyx_v_filter_list); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_length_filter = __pyx_t_7;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1684
 *             length_filter = len(filter_list)
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)
 */
  __pyx_t_8 = __pyx_v_variable_list_size;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "pyfmi\fmi.pyx":1686
 *         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":1688
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))
 *             data_variability = FMIL.fmi1_import_get_variability(variable)
 */
    __pyx_v_alias_kind = fmi1_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1689
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 *             data_variability = FMIL.fmi1_import_get_variability(variable)
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyBytes_FromString(fmi1_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":1690
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))
 *             data_variability = FMIL.fmi1_import_get_variability(variable)             # <<<<<<<<<<<<<<
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 */
    __pyx_v_data_variability = fmi1_import_get_variability(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1691
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))
 *             data_variability = FMIL.fmi1_import_get_variability(variable)
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 * 
 *             if data_type != FMI_REAL and data_type != FMI_INTEGER and data_type != FMI_BOOLEAN and data_type != FMI_ENUMERATION:
 */
    __pyx_v_data_type = fmi1_import_get_variable_base_type(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1693
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 *             if data_type != FMI_REAL and data_type != FMI_INTEGER and data_type != FMI_BOOLEAN and data_type != FMI_ENUMERATION:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_REAL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (__pyx_t_11) {
    } else {
      __pyx_t_3 = __pyx_t_11;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_10 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_INTEGER); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_11) {
    } else {
      __pyx_t_3 = __pyx_t_11;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_1 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_BOOLEAN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (__pyx_t_11) {
    } else {
      __pyx_t_3 = __pyx_t_11;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_10 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_ENUMERATION); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __pyx_t_11;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_3) {

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

    /* "pyfmi\fmi.pyx":1696
 *                 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 = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_CONTINUOUS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (__pyx_t_11) {
    } else {
      __pyx_t_3 = __pyx_t_11;
      goto __pyx_L12_bool_binop_done;
    }
    __pyx_t_10 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_DISCRETE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __pyx_t_11;
    __pyx_L12_bool_binop_done:;
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1697
 * 
 *             if data_variability != FMI_CONTINUOUS and data_variability != FMI_DISCRETE:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if selected_filter:
 */
      goto __pyx_L4_continue;
    }

    /* "pyfmi\fmi.pyx":1699
 *                 continue
 * 
 *             if selected_filter:             # <<<<<<<<<<<<<<
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):
 */
    __pyx_t_3 = (__pyx_v_selected_filter != 0);
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1700
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     if re.match(filter_list[j], name):
 *                         break
 */
      __pyx_t_2 = __pyx_v_length_filter;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
        __pyx_v_j = __pyx_t_12;

        /* "pyfmi\fmi.pyx":1701
 *             if selected_filter:
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_match); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(__pyx_v_filter_list == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_filter_list, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_7 = 1;
          }
        }
        __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_6) {
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
        }
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        __pyx_t_4 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __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_10); __pyx_t_10 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_3) {

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

        /* "pyfmi\fmi.pyx":1704
 *                         break
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 *             else:
 *                 if alias_kind != FMIL.fmi1_variable_is_not_alias:
 */
        goto __pyx_L4_continue;
      }
      __pyx_L16_break:;
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":1706
 *                     continue
 *             else:
 *                 if alias_kind != FMIL.fmi1_variable_is_not_alias:             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
      __pyx_t_3 = ((__pyx_v_alias_kind != fmi1_variable_is_not_alias) != 0);
      if (__pyx_t_3) {

        /* "pyfmi\fmi.pyx":1707
 *             else:
 *                 if alias_kind != FMIL.fmi1_variable_is_not_alias:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if alias_kind == FMIL.fmi1_variable_is_not_alias:
 */
        goto __pyx_L4_continue;
      }
    }
    __pyx_L14:;

    /* "pyfmi\fmi.pyx":1709
 *                     continue
 * 
 *             if alias_kind == FMIL.fmi1_variable_is_not_alias:             # <<<<<<<<<<<<<<
 *                 value_ref = FMIL.fmi1_import_get_variable_vr(variable)
 *             else:
 */
    __pyx_t_3 = ((__pyx_v_alias_kind == fmi1_variable_is_not_alias) != 0);
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1710
 * 
 *             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_L19;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":1712
 *                 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":1713
 *             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_L19:;

    /* "pyfmi\fmi.pyx":1715
 *                 value_ref  = FMIL.fmi1_import_get_variable_vr(base_variable)
 * 
 *             if data_type == FMI_REAL:             # <<<<<<<<<<<<<<
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI_INTEGER or data_type == FMI_ENUMERATION:
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_REAL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1716
 * 
 *             if data_type == FMI_REAL:
 *                 real_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 *             if data_type == FMI_INTEGER or data_type == FMI_ENUMERATION:
 *                 int_var_ref[value_ref] = 1
 */
      __pyx_t_5 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_v_real_var_ref, __pyx_t_5, __pyx_int_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L20;
    }
    __pyx_L20:;

    /* "pyfmi\fmi.pyx":1717
 *             if data_type == FMI_REAL:
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI_INTEGER or data_type == FMI_ENUMERATION:             # <<<<<<<<<<<<<<
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI_BOOLEAN:
 */
    __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_INTEGER); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_11) {
    } else {
      __pyx_t_3 = __pyx_t_11;
      goto __pyx_L22_bool_binop_done;
    }
    __pyx_t_1 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_ENUMERATION); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __pyx_t_11;
    __pyx_L22_bool_binop_done:;
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1718
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI_INTEGER or data_type == FMI_ENUMERATION:
 *                 int_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 *             if data_type == FMI_BOOLEAN:
 *                 bool_var_ref[value_ref] = 1
 */
      __pyx_t_5 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_v_int_var_ref, __pyx_t_5, __pyx_int_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L21;
    }
    __pyx_L21:;

    /* "pyfmi\fmi.pyx":1719
 *             if data_type == FMI_INTEGER or data_type == FMI_ENUMERATION:
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI_BOOLEAN:             # <<<<<<<<<<<<<<
 *                 bool_var_ref[value_ref] = 1
 * 
 */
    __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_BOOLEAN); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1720
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI_BOOLEAN:
 *                 bool_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 * 
 *         #Free the variable list
 */
      __pyx_t_1 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(PyDict_SetItem(__pyx_v_bool_var_ref, __pyx_t_1, __pyx_int_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L24;
    }
    __pyx_L24:;
    __pyx_L4_continue:;
  }

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

  /* "pyfmi\fmi.pyx":1725
 *         FMIL.fmi1_import_free_variable_list(variable_list)
 * 
 *         return list(real_var_ref.keys()) if python3_flag else real_var_ref.keys(), list(int_var_ref.keys()) if python3_flag else int_var_ref.keys(), list(bool_var_ref.keys()) if python3_flag else bool_var_ref.keys()             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_alias_base(self, variable_name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3_flag); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__pyx_t_3) {
    __pyx_t_10 = __Pyx_PyDict_Keys(__pyx_v_real_var_ref); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __pyx_t_10;
    __pyx_t_10 = 0;
  } else {
    __pyx_t_10 = __Pyx_PyDict_Keys(__pyx_v_real_var_ref); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = __pyx_t_10;
    __pyx_t_10 = 0;
  }
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3_flag); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_3) {
    __pyx_t_5 = __Pyx_PyDict_Keys(__pyx_v_int_var_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __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 = 1725; __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __pyx_t_5 = __Pyx_PyDict_Keys(__pyx_v_int_var_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3_flag); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyDict_Keys(__pyx_v_bool_var_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __pyx_t_4 = __Pyx_PyDict_Keys(__pyx_v_bool_var_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __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);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_10 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":1643
 *         return variable_dict
 * 
 *     def get_model_time_varying_value_references(self, filter=None):             # <<<<<<<<<<<<<<
 *         """
 *         Extract the value references of the variables in a model
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_model_time_varying_value_references", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XDECREF(__pyx_v_filter_list);
  __Pyx_XDECREF(__pyx_v_real_var_ref);
  __Pyx_XDECREF(__pyx_v_int_var_ref);
  __Pyx_XDECREF(__pyx_v_bool_var_ref);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1727
 *         return list(real_var_ref.keys()) if python3_flag else real_var_ref.keys(), list(int_var_ref.keys()) if python3_flag else int_var_ref.keys(), list(bool_var_ref.keys()) if python3_flag else bool_var_ref.keys()
 * 
 *     def get_variable_alias_base(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the base variable for the provided variable name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_63get_variable_alias_base(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_62get_variable_alias_base[] = "\n        Returns the base variable for the provided variable name.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_63get_variable_alias_base(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_alias_base (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_62get_variable_alias_base(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_62get_variable_alias_base(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_variable_t *__pyx_v_base_variable;
  char *__pyx_v_variablename;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_alias_base", 0);
  __Pyx_INCREF(__pyx_v_variable_name);

  /* "pyfmi\fmi.pyx":1734
 *         cdef FMIL.fmi1_value_reference_t vr
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

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

    /* "pyfmi\fmi.pyx":1739
 *         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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_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 = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1741
 *             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":1742
 * 
 *         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_6 = ((__pyx_v_base_variable == NULL) != 0);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":1743
 *         base_variable = FMIL.fmi1_import_get_variable_alias_base(self._fmu, variable)
 *         if base_variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         name = decode(FMIL.fmi1_import_get_variable_name(base_variable))
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1745
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         name = decode(FMIL.fmi1_import_get_variable_name(base_variable))             # <<<<<<<<<<<<<<
 * 
 *         return name
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyBytes_FromString(fmi1_import_get_variable_name(__pyx_v_base_variable)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1747
 *         name = decode(FMIL.fmi1_import_get_variable_name(base_variable))
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_alias(self, variable_name):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_name);
  __pyx_r = __pyx_v_name;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":1727
 *         return list(real_var_ref.keys()) if python3_flag else real_var_ref.keys(), list(int_var_ref.keys()) if python3_flag else int_var_ref.keys(), list(bool_var_ref.keys()) if python3_flag else bool_var_ref.keys()
 * 
 *     def get_variable_alias_base(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the base variable for the provided variable name.
 */

  /* function exit code */
  __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_7);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_alias_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1749
 *         return name
 * 
 *     def get_variable_alias(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Return a dict of all alias variables belonging to the provided variable
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_64get_variable_alias[] = "\n        Return a dict of all alias variables belonging to the provided variable\n        where the key are the names and the value indicating whether the variable\n        should be negated or not.\n\n        Returns::\n\n            A dict consisting of the alias variables along with no alias variable.\n            The values indicates wheter or not the variable should be negated or not.\n\n        Raises::\n\n            FMUException if the variable is not in the model.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_alias (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_64get_variable_alias(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_64get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  fmi1_import_variable_t *__pyx_v_variable;
  struct fmi1_import_variable_list_t *__pyx_v_alias_list;
  size_t __pyx_v_alias_list_size;
  enum fmi1_variable_alias_kind_enu_t __pyx_v_alias_kind;
  PyObject *__pyx_v_ret_values = 0;
  char *__pyx_v_variablename;
  size_t __pyx_v_i;
  PyObject *__pyx_v_alias_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_alias", 0);
  __Pyx_INCREF(__pyx_v_variable_name);

  /* "pyfmi\fmi.pyx":1768
 *         cdef FMIL.size_t alias_list_size
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 *         cdef dict ret_values = {}             # <<<<<<<<<<<<<<
 * 
 *         variable_name = encode(variable_name)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ret_values = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1770
 *         cdef dict ret_values = {}
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":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)
 * 
 */
  __pyx_t_6 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":1775
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_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 = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1777
 *             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":1779
 *         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":1782
 * 
 *         #Loop over all the alias variables
 *         for i in range(alias_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi1_import_get_variable(alias_list, i)
 */
  __pyx_t_8 = __pyx_v_alias_list_size;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "pyfmi\fmi.pyx":1784
 *         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":1786
 *             variable = FMIL.fmi1_import_get_variable(alias_list, i)
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             alias_name = decode(FMIL.fmi1_import_get_variable_name(variable))
 * 
 */
    __pyx_v_alias_kind = fmi1_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1787
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             alias_name = decode(FMIL.fmi1_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 * 
 *             ret_values[alias_name] = alias_kind
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyBytes_FromString(fmi1_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_alias_name, __pyx_t_1);
    __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":1792
 * 
 *         #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":1794
 *         FMIL.fmi1_import_free_variable_list(alias_list)
 * 
 *         return ret_values             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_variability_enu_t get_variable_variability(self, variable_name) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret_values);
  __pyx_r = __pyx_v_ret_values;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":1749
 *         return name
 * 
 *     def get_variable_alias(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Return a dict of all alias variables belonging to the provided variable
 */

  /* function exit code */
  __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_7);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret_values);
  __Pyx_XDECREF(__pyx_v_alias_name);
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static enum fmi1_variability_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_variability_enu_t __pyx_v_variability;
  char *__pyx_v_variablename;
  enum fmi1_variability_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  enum fmi1_variability_enu_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_variability", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_variability); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_variable_variability)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __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_3); __pyx_t_3 = 0;
      __pyx_t_6 = ((enum fmi1_variability_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1814
 *         cdef FMIL.fmi1_variability_enu_t variability
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __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_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":1818
 * 
 *         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_8 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":1819
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         variability = FMIL.fmi1_import_get_variability(variable)
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_variability", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_66get_variable_variability[] = "\n        Get variability of variable.\n\n        Parameters::\n\n            variablename --\n\n                The name of the variable.\n\n        Returns::\n\n            The variability of the variable, CONTINUOUS(3), CONSTANT(0),\n            PARAMETER(1) or DISCRETE(2)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_variability (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_66get_variable_variability(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_66get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fmi1_variability_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_variability", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_variability(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __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 = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_68get_variable_by_valueref[] = "\n        Get the name of a variable given a value reference. Note that it\n        returns the no-aliased variable.\n\n        Parameters::\n\n            valueref --\n                The value reference of the variable\n\n            type --\n                The type of the variables (Real==0, Int==1, Bool=2,\n                String==3, Enumeration==4). Default 0 (i.e Real).\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  fmi1_value_reference_t __pyx_v_valueref;
  PyObject *__pyx_v_type = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_by_valueref (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_valueref,&__pyx_n_s_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_variable_by_valueref") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __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_As_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 = 1824; __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 = 1824; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_by_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_68get_variable_by_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_68get_variable_by_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, fmi1_value_reference_t __pyx_v_valueref, PyObject *__pyx_v_type) {
  fmi1_import_variable_t *__pyx_v_variable;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fmi1_base_type_enu_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  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("get_variable_by_valueref", 0);

  /* "pyfmi\fmi.pyx":1840
 *         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 = 1840; __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":1841
 * 
 *         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) != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":1842
 *         variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, type, valueref)
 *         if variable==NULL:
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)             # <<<<<<<<<<<<<<
 * 
 *         name = decode(FMIL.fmi1_import_get_variable_name(variable))
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_fmi1_value_reference_t(__pyx_v_valueref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_with_the_valuref_i, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __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 = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1844
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)
 * 
 *         name = decode(FMIL.fmi1_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 * 
 *         return name
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyBytes_FromString(fmi1_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1844; __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 = NULL;
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1844; __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_v_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1846
 *         name = decode(FMIL.fmi1_import_get_variable_name(variable))
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_causality_enu_t get_variable_causality(self, variable_name) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_name);
  __pyx_r = __pyx_v_name;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_by_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static enum fmi1_causality_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_causality_enu_t __pyx_v_causality;
  char *__pyx_v_variablename;
  enum fmi1_causality_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  enum fmi1_causality_enu_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_causality", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_causality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_variable_causality)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __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_3); __pyx_t_3 = 0;
      __pyx_t_6 = ((enum fmi1_causality_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1865
 *         cdef FMIL.fmi1_causality_enu_t causality
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); 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);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); 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);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":1869
 * 
 *         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_8 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":1870
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         causality = FMIL.fmi1_import_get_causality(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1872
 *             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":1874
 *         causality = FMIL.fmi1_import_get_causality(variable)
 * 
 *         return causality             # <<<<<<<<<<<<<<
 * 
 *     def get_name(self):
 */
  __pyx_r = __pyx_v_causality;
  goto __pyx_L0;

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_causality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_70get_variable_causality[] = "\n        Get the causality of the variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The variability of the variable, INPUT(0), OUTPUT(1),\n            INTERNAL(2), NONE(3)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_causality (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_70get_variable_causality(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_70get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fmi1_causality_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_causality", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_causality(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __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 = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_73get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_72get_name[] = "\n        Return the model name as used in the modeling environment.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_73get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_name (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_72get_name(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1882
 *         return self._modelname
 * 
 *     def get_identifier(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model identifier, name of binary model file and prefix in
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_75get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_74get_identifier[] = "\n        Return the model identifier, name of binary model file and prefix in\n        the C-function names of the model.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_75get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_identifier (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_74get_identifier(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* "pyfmi\fmi.pyx":1882
 *         return self._modelname
 * 
 *     def get_identifier(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model identifier, name of binary model file and prefix in
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_77get_author(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_76get_author[] = "\n        Return the name and organization of the model author.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_77get_author(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_author (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_76get_author(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_76get_author(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  char *__pyx_v_author;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_author", 0);

  /* "pyfmi\fmi.pyx":1894
 *         """
 *         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":1895
 *         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) != 0)) {
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_author); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_s__2);
    __pyx_t_1 = __pyx_kp_s__2;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":1897
 *         return author if author != NULL else ""
 * 
 *     def get_default_experiment_start_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment start time as defined the XML
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_79get_default_experiment_start_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_78get_default_experiment_start_time[] = "\n        Returns the default experiment start time as defined the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_79get_default_experiment_start_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_experiment_start_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_78get_default_experiment_start_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_78get_default_experiment_start_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_default_experiment_start_time", 0);

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

  /* "pyfmi\fmi.pyx":1897
 *         return author if author != NULL else ""
 * 
 *     def get_default_experiment_start_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment start time as defined the XML
 */

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_81get_default_experiment_stop_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_80get_default_experiment_stop_time[] = "\n        Returns the default experiment stop time as defined the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_81get_default_experiment_stop_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_experiment_stop_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_80get_default_experiment_stop_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_80get_default_experiment_stop_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_default_experiment_stop_time", 0);

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

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

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_83get_default_experiment_tolerance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_82get_default_experiment_tolerance[] = "\n        Returns the default experiment tolerance as defined in the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_83get_default_experiment_tolerance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_experiment_tolerance (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_82get_default_experiment_tolerance(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_82get_default_experiment_tolerance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_default_experiment_tolerance", 0);

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

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

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":1918
 *         return FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)
 * 
 *     def get_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model description.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_85get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_84get_description[] = "\n        Return the model description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_85get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_description (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_84get_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_84get_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  char *__pyx_v_desc;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_description", 0);

  /* "pyfmi\fmi.pyx":1923
 *         """
 *         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":1924
 *         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) != 0)) {
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_desc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_s__2);
    __pyx_t_1 = __pyx_kp_s__2;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":1918
 *         return FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)
 * 
 *     def get_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model description.
 */

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_87get_generation_tool(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_86get_generation_tool[] = "\n        Return the model generation tool.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_87get_generation_tool(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_generation_tool (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_86get_generation_tool(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_86get_generation_tool(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  char *__pyx_v_gen;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_generation_tool", 0);

  /* "pyfmi\fmi.pyx":1931
 *         """
 *         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":1932
 *         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) != 0)) {
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_gen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_s__2);
    __pyx_t_1 = __pyx_kp_s__2;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_89get_guid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_88get_guid[] = "\n        Return the model GUID.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_89get_guid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_guid (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_88get_guid(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_88get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_v_guid = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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_guid", 0);

  /* "pyfmi\fmi.pyx":1938
 *         Return the model GUID.
 *         """
 *         guid = decode(FMIL.fmi1_import_get_GUID(self._fmu))             # <<<<<<<<<<<<<<
 *         return guid
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBytes_FromString(fmi1_import_get_GUID(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1938; __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 = NULL;
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1938; __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_v_guid = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1939
 *         """
 *         guid = decode(FMIL.fmi1_import_get_GUID(self._fmu))
 *         return guid             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_guid);
  __pyx_r = __pyx_v_guid;
  goto __pyx_L0;

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase.get_guid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_guid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":88
 * 
 *     #Internal values
 *     cdef public object __t             # <<<<<<<<<<<<<<
 *     cdef public object _file_open
 *     cdef public object _npoints
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":89
 *     #Internal values
 *     cdef public object __t
 *     cdef public object _file_open             # <<<<<<<<<<<<<<
 *     cdef public object _npoints
 *     cdef public object _enable_logging
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":90
 *     cdef public object __t
 *     cdef public object _file_open
 *     cdef public object _npoints             # <<<<<<<<<<<<<<
 *     cdef public object _enable_logging
 *     cdef public object _pyEventInfo
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":91
 *     cdef public object _file_open
 *     cdef public object _npoints
 *     cdef public object _enable_logging             # <<<<<<<<<<<<<<
 *     cdef public object _pyEventInfo
 *     cdef list _log
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":92
 *     cdef public object _npoints
 *     cdef public object _enable_logging
 *     cdef public object _pyEventInfo             # <<<<<<<<<<<<<<
 *     cdef list _log
 *     cdef int _version
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":101
 *     cdef unsigned int _nEventIndicators
 *     cdef unsigned int _nContinuousStates
 *     cdef public list _save_real_variables_val             # <<<<<<<<<<<<<<
 *     cdef public list _save_int_variables_val
 *     cdef public list _save_bool_variables_val
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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(__pyx_v_self->_save_real_variables_val);
  __pyx_r = __pyx_v_self->_save_real_variables_val;
  goto __pyx_L0;

  /* function exit code */
  __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));

  /* function exit code */
  __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
  PyObject *__pyx_t_1 = NULL;
  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 %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_save_real_variables_val);
  __Pyx_DECREF(__pyx_v_self->_save_real_variables_val);
  __pyx_v_self->_save_real_variables_val = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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));

  /* function exit code */
  __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(__pyx_v_self->_save_real_variables_val);
  __pyx_v_self->_save_real_variables_val = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":102
 *     cdef unsigned int _nContinuousStates
 *     cdef public list _save_real_variables_val
 *     cdef public list _save_int_variables_val             # <<<<<<<<<<<<<<
 *     cdef public list _save_bool_variables_val
 *     cdef int _fmu_kind
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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(__pyx_v_self->_save_int_variables_val);
  __pyx_r = __pyx_v_self->_save_int_variables_val;
  goto __pyx_L0;

  /* function exit code */
  __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));

  /* function exit code */
  __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
  PyObject *__pyx_t_1 = NULL;
  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 %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_save_int_variables_val);
  __Pyx_DECREF(__pyx_v_self->_save_int_variables_val);
  __pyx_v_self->_save_int_variables_val = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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));

  /* function exit code */
  __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(__pyx_v_self->_save_int_variables_val);
  __pyx_v_self->_save_int_variables_val = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":103
 *     cdef public list _save_real_variables_val
 *     cdef public list _save_int_variables_val
 *     cdef public list _save_bool_variables_val             # <<<<<<<<<<<<<<
 *     cdef int _fmu_kind
 *     cdef char* _fmu_log_name
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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(__pyx_v_self->_save_bool_variables_val);
  __pyx_r = __pyx_v_self->_save_bool_variables_val;
  goto __pyx_L0;

  /* function exit code */
  __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));

  /* function exit code */
  __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
  PyObject *__pyx_t_1 = NULL;
  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 %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_save_bool_variables_val);
  __Pyx_DECREF(__pyx_v_self->_save_bool_variables_val);
  __pyx_v_self->_save_bool_variables_val = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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));

  /* function exit code */
  __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(__pyx_v_self->_save_bool_variables_val);
  __pyx_v_self->_save_bool_variables_val = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fmu,&__pyx_n_s_path,&__pyx_n_s_enable_logging,&__pyx_n_s_log_file_name,&__pyx_n_s_log_level,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s__10);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_kp_s__2);
    values[4] = __pyx_k__46;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_level);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __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 = 1946; __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);

  /* function exit code */
  __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;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":1948
 *     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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelBase)), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(6+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __Pyx_INCREF(__pyx_v_log_file_name);
  PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_log_file_name);
  __Pyx_GIVEREF(__pyx_v_log_file_name);
  __Pyx_INCREF(__pyx_v_log_level);
  PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_4, __pyx_v_log_level);
  __Pyx_GIVEREF(__pyx_v_log_level);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1950
 *         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_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._fmu_kind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_CS_STANDALONE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":1951
 * 
 *         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_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __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 = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":1953
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_instantiate_slave); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_logging, __pyx_v_self->__pyx_base._enable_logging) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __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":1955
 *         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;
  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_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __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_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__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":1956
 * 
 *     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;

  /* "pyfmi\fmi.pyx":1955
 *         self.instantiate_slave(logging = self._enable_logging)
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         return self.__t
 * 
 */

  /* function exit code */
  __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.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));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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 = __pyx_f_5pyfmi_3fmi_11FMUModelCS1__get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":1958
 *         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;
  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("_set_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    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_3 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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":1959
 * 
 *     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 = 1959; __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":1958
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):             # <<<<<<<<<<<<<<
 *         self.__t = t
 * 
 */

  /* function exit code */
  __pyx_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_6);
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  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 = 1958; __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));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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 = __pyx_f_5pyfmi_3fmi_11FMUModelCS1__set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":1967
 *     """)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

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":1971
 *         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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1972
 *         """
 *         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":1973
 *         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":1975
 *             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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1976
 * 
 *         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":1978
 *             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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1979
 * 
 *         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":1981
 *             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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1982
 * 
 *         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":1983
 *         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":1984
 *             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":1986
 *             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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1987
 * 
 *         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":1989
 *             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) != 0);
  if (__pyx_t_1) {

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

  /* "pyfmi\fmi.pyx":1967
 *     """)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

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

/* 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_step (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_current_t,&__pyx_n_s_step_size,&__pyx_n_s_new_step,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_current_t)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_step_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_step", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __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 = 1993; __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 = 1993; __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 = 1993; __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 = 1993; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

  /* "pyfmi\fmi.pyx":2025
 *             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 = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2027
 *         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":2029
 *         status = FMIL.fmi1_import_do_step(self._fmu, current_t, step_size, new_s)
 * 
 *         return status             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2032
 * 
 * 
 *     def cancel_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         Cancel a current integrator step. Can only be called if the
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":2037
 *         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 = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":2032
 * 
 * 
 *     def cancel_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         Cancel a current integrator step. Can only be called if the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.cancel_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2039
 *         raise NotImplementedError
 * 
 *     def get_output_derivatives(self, variables, FMIL.fmi1_integer_t order):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the output derivatives for the specified variables. The
 */

/* 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_output_derivatives (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_variables,&__pyx_n_s_order,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_variables)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_order)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_output_derivatives", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __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 = 2039; __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_As_fmi1_integer_t(values[1]); if (unlikely((__pyx_v_order == (fmi1_integer_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __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 = 2039; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  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;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  fmi1_value_reference_t __pyx_t_15;
  long __pyx_t_16;
  int __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":2060
 *         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":2061
 * 
 *         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":2063
 *         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_2 = ((__pyx_v_order < 1) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_order > __pyx_v_max_output_derivative) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2064
 * 
 *         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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_output_derivative); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_The_order_must_be_greater_than_z, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __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 = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2066
 *             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_1 = PyString_Check(__pyx_v_variables); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2067
 * 
 *         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":2068
 *         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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __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 = 2068; __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_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __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 = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
    {
      __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 = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":2069
 *             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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_fmi1_integer_t(__pyx_v_order); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __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 = 2069; __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":2070
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()
 *             orders = N.array(order, dtype=N.int32)
 *             value_refs[0] = self.get_variable_valueref(variables)             # <<<<<<<<<<<<<<
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 *             nref = len(variables)
 */
    __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_variables, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_15;
    goto __pyx_L6;
  }

  /* "pyfmi\fmi.pyx":2071
 *             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_1 = PyList_Check(__pyx_v_variables); 
  __pyx_t_17 = (__pyx_t_1 != 0);
  if (__pyx_t_17) {
  } else {
    __pyx_t_2 = __pyx_t_17;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_variables, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_17 = PyString_Check(__pyx_t_7); 
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_1 = (__pyx_t_17 != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_2) {

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

    /* "pyfmi\fmi.pyx":2073
 *         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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
      }
    }
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __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_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_flatten); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_7);
    {
      __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 = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":2074
 *             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_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_8);
    {
      __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 = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = 0;
    __pyx_v_orders = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "pyfmi\fmi.pyx":2075
 *             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":2076
 *             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_8 = __Pyx_GetItemInt(__pyx_v_variables, __pyx_v_i, size_t, 0, __Pyx_PyInt_From_size_t, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __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 = 2076; __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_15;

      /* "pyfmi\fmi.pyx":2077
 *             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 = 2077; __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_L6;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2079
 *                 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":2081
 *             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_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __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)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __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_float_0_0);
      PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
      __Pyx_GIVEREF(__pyx_float_0_0);
    }
  }
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_23 = ((PyArrayObject *)__pyx_t_4);
  {
    __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 = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_23 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2083
 *         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":2085
 *         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) != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2086
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":2039
 *         raise NotImplementedError
 * 
 *     def get_output_derivatives(self, variables, FMIL.fmi1_integer_t order):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the output derivatives for the specified variables. The
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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;
}

/* "pyfmi\fmi.pyx":2090
 *         return values
 * 
 *     def _get_types_platform(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the set of valid compatible platforms for the Model, extracted
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":2104
 *             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 = __Pyx_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 = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":2090
 *         return values
 * 
 *     def _get_types_platform(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the set of valid compatible platforms for the Model, extracted
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2108
 *     types_platform = property(fget=_get_types_platform)
 * 
 *     def get_real_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_17get_real_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_16get_real_status[] = "\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_17get_real_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_real_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_16get_real_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_16get_real_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  fmi1_real_t __pyx_v_value;
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_real_status", 0);

  /* "pyfmi\fmi.pyx":2111
 *         """
 *         """
 *         cdef FMIL.fmi1_real_t value = 0.0             # <<<<<<<<<<<<<<
 *         cdef int status
 * 
 */
  __pyx_v_value = 0.0;

  /* "pyfmi\fmi.pyx":2114
 *         cdef int status
 * 
 *         if status_kind == FMIL.fmi1_last_successful_time:             # <<<<<<<<<<<<<<
 *             status = FMIL.fmi1_import_get_real_status(self._fmu, FMIL.fmi1_last_successful_time, &value)
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_last_successful_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2115
 * 
 *         if status_kind == FMIL.fmi1_last_successful_time:
 *             status = FMIL.fmi1_import_get_real_status(self._fmu, FMIL.fmi1_last_successful_time, &value)             # <<<<<<<<<<<<<<
 * 
 *             if status != 0:
 */
    __pyx_v_status = fmi1_import_get_real_status(__pyx_v_self->__pyx_base._fmu, fmi1_last_successful_time, (&__pyx_v_value));

    /* "pyfmi\fmi.pyx":2117
 *             status = FMIL.fmi1_import_get_real_status(self._fmu, FMIL.fmi1_last_successful_time, &value)
 * 
 *             if status != 0:             # <<<<<<<<<<<<<<
 *                 raise FMUException('Failed to retrieve the last successful time. See the log for possibly more information.')
 * 
 */
    __pyx_t_3 = ((__pyx_v_status != 0) != 0);
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":2118
 * 
 *             if status != 0:
 *                 raise FMUException('Failed to retrieve the last successful time. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *             return value
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; __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 = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "pyfmi\fmi.pyx":2120
 *                 raise FMUException('Failed to retrieve the last successful time. See the log for possibly more information.')
 * 
 *             return value             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Not supported status kind.')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2122
 *             return value
 *         else:
 *             raise FMUException('Not supported status kind.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __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 = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2108
 *     types_platform = property(fget=_get_types_platform)
 * 
 *     def get_real_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.get_real_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2125
 * 
 * 
 *     def set_input_derivatives(self, variables, values, orders):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the input derivative order for the specified variables.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_19set_input_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_18set_input_derivatives[] = "\n        Sets the input derivative order for the specified variables.\n\n        Parameters::\n\n                variables --\n                        The variables for which the input derivative\n                        should be set.\n                values --\n                        The actual values.\n                order --\n                        The derivative orders to set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_19set_input_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variables = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_orders = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_derivatives (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_variables,&__pyx_n_s_values,&__pyx_n_s_orders,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_variables)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_orders)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __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 = 2125; __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 = 2125; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.set_input_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_18set_input_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_variables, __pyx_v_values, __pyx_v_orders);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_18set_input_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_values, PyObject *__pyx_v_orders) {
  int __pyx_v_status;
  int __pyx_v_can_interpolate_inputs;
  size_t __pyx_v_nref;
  fmi1_import_capabilities_t *__pyx_v_fmu_capabilities;
  PyArrayObject *__pyx_v_np_orders = 0;
  PyArrayObject *__pyx_v_value_refs = 0;
  PyArrayObject *__pyx_v_val = 0;
  Py_ssize_t __pyx_v_i;
  __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;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  PyArrayObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  fmi1_value_reference_t __pyx_t_19;
  long __pyx_t_20;
  int __pyx_t_21;
  size_t __pyx_t_22;
  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":2143
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_orders);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_orders);
  __Pyx_GIVEREF(__pyx_v_orders);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __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 = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_np_orders.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__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 = 2143; __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_7 = 0;
  __pyx_v_np_orders = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2145
 *         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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__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 = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __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 = 2145; __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_1);
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":2148
 * 
 *         nref = len(val)
 *         orders = N.array([0]*nref, dtype=N.int32)             # <<<<<<<<<<<<<<
 * 
 *         if nref != len(np_orders):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2148; __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_int_0);
      PyList_SET_ITEM(__pyx_t_1, __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 = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_orders, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "pyfmi\fmi.pyx":2150
 *         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_9 = PyObject_Length(((PyObject *)__pyx_v_np_orders)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = ((__pyx_v_nref != __pyx_t_9) != 0);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":2151
 * 
 *         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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __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 = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2153
 *             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":2154
 * 
 *         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":2157
 *         #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_9 = PyObject_Length(((PyObject *)__pyx_v_np_orders)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pyfmi\fmi.pyx":2158
 * 
 *         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_12 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_pybuffernd_np_orders.diminfo[0].shape;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_np_orders.diminfo[0].shape)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = (((*__Pyx_BufPtrCContig1d(fmi1_integer_t *, __pyx_pybuffernd_np_orders.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_np_orders.diminfo[0].strides)) < 1) != 0);
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":2159
 *         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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); 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_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __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 = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

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

    /* "pyfmi\fmi.pyx":2161
 *                 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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __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 = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2163
 *             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_10 = PyString_Check(__pyx_v_variables); 
  __pyx_t_14 = (__pyx_t_10 != 0);
  if (__pyx_t_14) {

    /* "pyfmi\fmi.pyx":2164
 * 
 *         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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __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 = 2164; __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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 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 = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flatten); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_13 < 0)) {
        PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_15 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":2165
 *         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_19 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_variables, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_20 = 0;
    __pyx_t_13 = -1;
    if (__pyx_t_20 < 0) {
      __pyx_t_20 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_20 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_19;
    goto __pyx_L8;
  }

  /* "pyfmi\fmi.pyx":2166
 *             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_10 = PyList_Check(__pyx_v_variables); 
  __pyx_t_21 = (__pyx_t_10 != 0);
  if (__pyx_t_21) {
  } else {
    __pyx_t_14 = __pyx_t_21;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_variables, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_21 = PyString_Check(__pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = (__pyx_t_21 != 0);
  __pyx_t_14 = __pyx_t_10;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_14) {

    /* "pyfmi\fmi.pyx":2167
 *             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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    { 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_6, __pyx_temp, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
      }
    }
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 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 = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __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_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flatten); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_13 < 0)) {
        PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_15 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":2168
 *         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_22 = __pyx_v_nref;
    for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_22; __pyx_t_9+=1) {
      __pyx_v_i = __pyx_t_9;

      /* "pyfmi\fmi.pyx":2169
 *             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 = __Pyx_GetItemInt(__pyx_v_variables, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_19 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = __pyx_v_i;
      __pyx_t_13 = -1;
      if (__pyx_t_11 < 0) {
        __pyx_t_11 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
        if (unlikely(__pyx_t_11 < 0)) __pyx_t_13 = 0;
      } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_13 = 0;
      if (unlikely(__pyx_t_13 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_13);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_19;
    }
    goto __pyx_L8;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2171
 *                 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __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 = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":2173
 *             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":2175
 *         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_14 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_14) {

    /* "pyfmi\fmi.pyx":2176
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __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 = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2125
 * 
 * 
 *     def set_input_derivatives(self, variables, values, orders):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the input derivative order for the specified variables.
 */

  /* function exit code */
  __pyx_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_6);
  { 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_orders);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2178
 *             raise FMUException('Failed to set the Real input derivatives.')
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time='Default',
 *                  final_time='Default',
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_21simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_20simulate[] = "\n        Compact function for model simulation.\n\n        The simulation method depends on which algorithm is used, this can be\n        set with the function argument 'algorithm'. Options for the algorithm\n        are passed as option classes or as pure dicts. See\n        FMUModel.simulate_options for more details.\n\n        The default algorithm for this function is FMICSAlg.\n\n        Parameters::\n\n            start_time --\n                Start time for the simulation.\n                Default: Start time defined in the default experiment from\n                        the ModelDescription file.\n\n            final_time --\n                Final time for the simulation.\n                Default: Stop time defined in the default experiment from\n                        the ModelDescription file.\n\n            input --\n                Input signal for the simulation. The input should be a 2-tuple\n                consisting of first the names of the input variable(s) and then\n                the data matrix.\n                Default: Empty tuple.\n\n            algorithm --\n                The algorithm which will be used for the simulation is specified\n                by passing the algorithm class as string or class object in this\n                argument. 'algorithm' can be any class which implements the\n                abstract class AlgorithmBase (found in algorithm_drivers.py). In\n                this way it is possible to write own algorithms and use them\n                with this function.\n                Default: 'FMICSAlg'\n\n            options --\n                The options that should be used in the algorithm. For details on\n                the options do:\n\n                    >> myModel = FMUModel(...)\n                    >> opts = myModel.simulate_options()\n                    >> opts?\n\n                Valid values are:\n                    - A dict which gives AssimuloFMIAlgOptions with\n                      default valu""es on all options except the ones\n                      listed in the dict. Empty dict will thus give all\n                      options with default values.\n                    - An options object.\n                Default: Empty dict\n\n        Returns::\n\n            Result object, subclass of common.algorithm_drivers.ResultBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_21simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_final_time = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start_time,&__pyx_n_s_final_time,&__pyx_n_s_input,&__pyx_n_s_algorithm,&__pyx_n_s_options,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_n_s_Default);
    values[1] = ((PyObject *)__pyx_n_s_Default);

    /* "pyfmi\fmi.pyx":2181
 *                  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__57;
    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 = 2178; __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 = 2178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_20simulate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_start_time, __pyx_v_final_time, __pyx_v_input, __pyx_v_algorithm, __pyx_v_options);

  /* "pyfmi\fmi.pyx":2178
 *             raise FMUException('Failed to set the Real input derivatives.')
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time='Default',
 *                  final_time='Default',
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_20simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = 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":2241
 *             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, __pyx_n_s_Default, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2242
 *         """
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()             # <<<<<<<<<<<<<<
 *         if final_time == "Default":
 *             final_time = self.get_default_experiment_stop_time()
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_start_tim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_start_time, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

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

    /* "pyfmi\fmi.pyx":2244
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_stop_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_final_time, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

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

  /* "pyfmi\fmi.pyx":2251
 *                                              'pyfmi.fmi_algorithm_drivers',
 *                                              algorithm,
 *                                              options)             # <<<<<<<<<<<<<<
 * 
 *     def simulate_options(self, algorithm='FMICSAlg'):
 */
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(6+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_start_time);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start_time);
  __Pyx_GIVEREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_final_time);
  __Pyx_GIVEREF(__pyx_v_final_time);
  __Pyx_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_input);
  __Pyx_GIVEREF(__pyx_v_input);
  __Pyx_INCREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_GIVEREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_5, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_5, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":2178
 *             raise FMUException('Failed to set the Real input derivatives.')
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time='Default',
 *                  final_time='Default',
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_23simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_22simulate_options[] = "\n        Get an instance of the simulate options class, filled with default\n        values. If called without argument then the options class for the\n        default simulation algorithm will be returned.\n\n        Parameters::\n\n            algorithm --\n                The algorithm for which the options class should be fetched.\n                Possible values are: 'FMICSAlg'.\n                Default: 'FMICSAlg'\n\n        Returns::\n\n            Options class for the algorithm specified with default values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_23simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_algorithm,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s_FMICSAlg);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_algorithm);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __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 = 2253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_22simulate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_algorithm);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_22simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_algorithm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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("simulate_options", 0);

  /* "pyfmi\fmi.pyx":2270
 *             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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default_options); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_GIVEREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2270; __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2272
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def initialize(self, tStart=0.0, tStop=1.0, StopTimeDefined=False):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the slave.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_25initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_24initialize[] = "\n        Initializes the slave.\n\n        Parameters::\n\n            tStart -\n            tSTop --\n            StopTimeDefined --\n\n        Calls the low-level FMU function: fmiInstantiateSlave\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_25initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_tStart = 0;
  PyObject *__pyx_v_tStop = 0;
  PyObject *__pyx_v_StopTimeDefined = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tStart,&__pyx_n_s_tStop,&__pyx_n_s_StopTimeDefined,0};
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)__pyx_float_0_0);
    values[1] = ((PyObject *)__pyx_float_1_0);
    values[2] = ((PyObject *)Py_False);
    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 = 2272; __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 = 2272; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_24initialize(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_tStart, __pyx_v_tStop, __pyx_v_StopTimeDefined);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_24initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_tStart, PyObject *__pyx_v_tStop, PyObject *__pyx_v_StopTimeDefined) {
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_stopDefined;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi1_boolean_t __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":2285
 *         """
 *         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 = 2285; __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":2287
 *         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 (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time, __pyx_v_tStart) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":2289
 *         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 = 2289; __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 = 2289; __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":2291
 *         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) != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2292
 * 
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("The slave failed to initialize. See the log for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *         self._allocated_fmu = 1
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __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 = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2294
 *             raise FMUException("The slave failed to initialize. See the log for possibly more information.")
 * 
 *         self._allocated_fmu = 1             # <<<<<<<<<<<<<<
 * 
 *     def reset(self):
 */
  __pyx_v_self->__pyx_base._allocated_fmu = 1;

  /* "pyfmi\fmi.pyx":2272
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def initialize(self, tStart=0.0, tStop=1.0, StopTimeDefined=False):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the slave.
 */

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_27reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_26reset[] = "\n        This method resets the FMU according to the reset method defined\n        in the FMI1 specification.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_27reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_26reset(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_26reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);

  /* "pyfmi\fmi.pyx":2302
 *         """
 * 
 *         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":2303
 * 
 *         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) != 0);
  if (__pyx_t_1) {

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

  /* "pyfmi\fmi.pyx":2307
 * 
 *         #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":2310
 * 
 *         #Internal values
 *         self._file_open = False             # <<<<<<<<<<<<<<
 *         self._npoints = 0
 *         self._log = []
 */
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __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 = Py_False;

  /* "pyfmi\fmi.pyx":2311
 *         #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":2312
 *         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 = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._log);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._log);
  __pyx_v_self->__pyx_base._log = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

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

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_29instantiate_slave(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_28instantiate_slave[] = "\n        Instantiate the slave.\n\n        Parameters::\n\n            name --\n                The name of the instance.\n                Default: 'Slave'\n\n            logging --\n                Defines if the logging should be turned on or off.\n                Default: False, no logging.\n\n        Calls the low-level FMI function: fmiInstantiateSlave.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_29instantiate_slave(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_logging = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instantiate_slave (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_logging,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s_Slave);
    values[1] = ((PyObject *)Py_False);
    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 = 2315; __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 = 2315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.instantiate_slave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_28instantiate_slave(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_name, __pyx_v_logging);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_28instantiate_slave(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_logging) {
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_log;
  fmi1_real_t __pyx_v_timeout;
  fmi1_boolean_t __pyx_v_visible;
  fmi1_boolean_t __pyx_v_interactive;
  fmi1_string_t __pyx_v_location;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi1_boolean_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  fmi1_string_t __pyx_t_7;
  fmi1_string_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("instantiate_slave", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "pyfmi\fmi.pyx":2332
 *         """
 *         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 = 2332; __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":2333
 *         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":2334
 *         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":2335
 *         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":2336
 *         cdef FMIL.fmi1_boolean_t visible = 0
 *         cdef FMIL.fmi1_boolean_t interactive = 0
 *         cdef FMIL.fmi1_string_t location = NULL             # <<<<<<<<<<<<<<
 * 
 *         name = encode(name)
 */
  __pyx_v_location = NULL;

  /* "pyfmi\fmi.pyx":2338
 *         cdef FMIL.fmi1_string_t location = NULL
 * 
 *         name = encode(name)             # <<<<<<<<<<<<<<
 *         status = FMIL.fmi1_import_instantiate_slave(self._fmu, name, location,
 *                                         FMI_MIME_CS_STANDALONE, timeout, visible,
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3);
  __pyx_t_3 = 0;

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

  /* "pyfmi\fmi.pyx":2340
 *         name = encode(name)
 *         status = FMIL.fmi1_import_instantiate_slave(self._fmu, name, location,
 *                                         FMI_MIME_CS_STANDALONE, timeout, visible,             # <<<<<<<<<<<<<<
 *                                         interactive)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_MIME_CS_STANDALONE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((__pyx_t_8 == (fmi1_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":2339
 * 
 *         name = encode(name)
 *         status = FMIL.fmi1_import_instantiate_slave(self._fmu, name, location,             # <<<<<<<<<<<<<<
 *                                         FMI_MIME_CS_STANDALONE, timeout, visible,
 *                                         interactive)
 */
  __pyx_v_status = fmi1_import_instantiate_slave(__pyx_v_self->__pyx_base._fmu, __pyx_t_7, __pyx_v_location, __pyx_t_8, __pyx_v_timeout, __pyx_v_visible, __pyx_v_interactive);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

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

    /* "pyfmi\fmi.pyx":2344
 * 
 *         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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2344; __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 = 2344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2348
 *         #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":2350
 *         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) != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2351
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def get_capability_flags(self):
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __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 = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* function exit code */
  __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_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.instantiate_slave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2353
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')
 * 
 *     def get_capability_flags(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the capability flags of the FMU.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_31get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_30get_capability_flags[] = "\n        Returns a dictionary with the capability flags of the FMU.\n\n        Capabilities::\n\n            canHandleVariableCommunicationStepSize\n            canHandleEvents\n            canRejectSteps\n            canInterpolateInputs\n            maxOutputDerivativeOrder\n            canRunAsynchronuously\n            canSignalEvents\n            canBeinstantiatedOnlyOncePerProcess\n            canNotUseMemoryManagementFunctions\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_31get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_capability_flags (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_30get_capability_flags(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_30get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self) {
  PyObject *__pyx_v_capabilities = 0;
  fmi1_import_capabilities_t *__pyx_v_cap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_capability_flags", 0);

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

  /* "pyfmi\fmi.pyx":2372
 *         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":2374
 *         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 = __Pyx_PyInt_From_int(fmi1_import_get_canHandleVariableCommunicationStepSize(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canHandleVariableCommunicationSt, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

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

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

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

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

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

  /* "pyfmi\fmi.pyx":2381
 *         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 = __Pyx_PyInt_From_int(fmi1_import_get_canBeInstantiatedOnlyOncePerProcess(__pyx_v_cap)); 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);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canBeInstantiatedOnlyOncePerProc, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":2384
 *         capabilities["canNotUseMemoryManagementFunctions"] = FMIL.fmi1_import_get_canNotUseMemoryManagementFunctions(cap)
 * 
 *         return capabilities             # <<<<<<<<<<<<<<
 * 
 * cdef class FMUModelME1(FMUModelBase):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_capabilities);
  __pyx_r = __pyx_v_capabilities;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":2353
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')
 * 
 *     def get_capability_flags(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the capability flags of the FMU.
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2391
 *     """
 * 
 *     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)
 */

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME1_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME1_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fmu,&__pyx_n_s_path,&__pyx_n_s_enable_logging,&__pyx_n_s_log_file_name,&__pyx_n_s_log_level,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s__10);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_kp_s__2);
    values[4] = __pyx_k__62;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_level);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2391; __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 = 2391; __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);

  /* function exit code */
  __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;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":2393
 *     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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelBase)), __pyx_n_s_init); 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 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(6+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __Pyx_INCREF(__pyx_v_log_file_name);
  PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_log_file_name);
  __Pyx_GIVEREF(__pyx_v_log_file_name);
  __Pyx_INCREF(__pyx_v_log_level);
  PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_4, __pyx_v_log_level);
  __Pyx_GIVEREF(__pyx_v_log_level);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2395
 *         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_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base._fmu_kind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_ME); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":2396
 * 
 *         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_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; __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 = 2396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2398
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_instantiate_model); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_logging, __pyx_v_self->__pyx_base._enable_logging) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2391
 *     """
 * 
 *     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)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2400
 *         self.instantiate_model(logging = self._enable_logging)
 * 
 *     def _get_model_types_platform(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the set of valid compatible platforms for the Model, extracted
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":2414
 *             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 = __Pyx_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 = 2414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":2400
 *         self.instantiate_model(logging = self._enable_logging)
 * 
 *     def _get_model_types_platform(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the set of valid compatible platforms for the Model, extracted
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2418
 *     model_types_platform = property(fget=_get_model_types_platform)
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         This metod resets the FMU by first calling fmiTerminate and
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_5reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_4reset[] = "\n        This metod resets the FMU by first calling fmiTerminate and\n        fmiFreeModelInstance and then reloads the DLL and finally\n        re-instantiates using fmiInstantiateModel.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_5reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_4reset(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":2424
 *         re-instantiates using fmiInstantiateModel.
 *         """
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base._allocated_fmu == 1) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2425
 *         """
 *         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":2426
 *         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":2428
 *             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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2429
 * 
 *         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":2432
 * 
 *         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_GetModuleGlobalName(__pyx_n_s_FMI_REGISTER_GLOBALLY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2432; __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":2433
 *         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) != 0);
  if (__pyx_t_1) {

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

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

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

  /* "pyfmi\fmi.pyx":2441
 * 
 *         #Internal values
 *         self._file_open = False             # <<<<<<<<<<<<<<
 *         self._npoints = 0
 *         self._log = []
 */
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __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 = Py_False;

  /* "pyfmi\fmi.pyx":2442
 *         #Internal values
 *         self._file_open = False
 *         self._npoints = 0             # <<<<<<<<<<<<<<
 *         self._log = []
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._npoints);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._npoints);
  __pyx_v_self->__pyx_base._npoints = __pyx_int_0;

  /* "pyfmi\fmi.pyx":2443
 *         self._file_open = False
 *         self._npoints = 0
 *         self._log = []             # <<<<<<<<<<<<<<
 * 
 *         #Instantiates the model
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._log);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._log);
  __pyx_v_self->__pyx_base._log = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2446
 * 
 *         #Instantiates the model
 *         self.instantiate_model(logging = self._enable_logging)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_instantiate_model); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; __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 = 2446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_logging, __pyx_v_self->__pyx_base._enable_logging) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":2418
 *     model_types_platform = property(fget=_get_model_types_platform)
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         This metod resets the FMU by first calling fmiTerminate and
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2449
 * 
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

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":2453
 *         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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2454
 *         """
 *         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":2455
 *         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":2457
 *             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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2458
 * 
 *         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":2460
 *             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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2461
 * 
 *         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":2463
 *             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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2464
 * 
 *         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":2465
 *         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":2466
 *             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":2468
 *             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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2469
 * 
 *         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":2471
 *             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) != 0);
  if (__pyx_t_1) {

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

  /* "pyfmi\fmi.pyx":2449
 * 
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":2475
 *             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;
  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_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_time); 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);
    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_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__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":2476
 * 
 *     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;

  /* "pyfmi\fmi.pyx":2475
 *             self._fmu_log_name = NULL
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         return self.__t
 * 
 */

  /* function exit code */
  __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.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));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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 = __pyx_f_5pyfmi_3fmi_11FMUModelME1__get_time(__pyx_v_self, 1); 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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":2478
 *         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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __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_3 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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":2480
 *     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 = 2480; __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":2482
 *         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":2484
 *         status = FMIL.fmi1_import_set_time(self._fmu,t)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the time.')
 * 
 */
  __pyx_t_7 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2485
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 * 
 *     time = property(_get_time,_set_time, doc =
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __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 = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2478
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         self.__t = t
 */

  /* function exit code */
  __pyx_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_6);
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  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 = 2478; __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));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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 = __pyx_f_5pyfmi_3fmi_11FMUModelME1__set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2493
 *     """)
 * 
 *     def _get_continuous_states(self):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef N.ndarray[double, ndim=1,mode='c'] ndx = N.zeros(self._nContinuousStates, dtype=N.double)
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":2495
 *     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_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __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_From_unsigned_int(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __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 = 2495; __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 = 2495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 2495; __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 = 2495; __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":2496
 *         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":2498
 *         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) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2499
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2499; __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 = 2499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":2493
 *     """)
 * 
 *     def _get_continuous_states(self):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef N.ndarray[double, ndim=1,mode='c'] ndx = N.zeros(self._nContinuousStates, dtype=N.double)
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2503
 *         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()
 */

/* 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) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  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 = 2503; __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));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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 = 2503; __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":2505
 *     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 = 2505; __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":2507
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ndx), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":2513
 *                 '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":2515
 *         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) != 0);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":2503
 *         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()
 */

  /* function exit code */
  __pyx_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;
}

/* "pyfmi\fmi.pyx":2525
 *     """)
 * 
 *     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)
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":2527
 *     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_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __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 = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 2527; __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 = 2527; __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":2529
 *         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(             # <<<<<<<<<<<<<<
 *                 self._fmu, <FMIL.fmi1_real_t*>ndx.data, self._nContinuousStates)
 * 
 */
  __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":2532
 *                 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) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2533
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __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 = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":2525
 *     """)
 * 
 *     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)
 */

  /* function exit code */
  __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":2543
 *     """)
 * 
 *     cpdef get_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the derivative of the continuous states.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_19get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME1_get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_values = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_derivatives", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_derivatives); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2543; __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_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__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":2559
 *         """
 *         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_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __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_From_unsigned_int(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __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 = 2559; __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 = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 2559; __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 = 2559; __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":2561
 *         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":2563
 *         status = FMIL.fmi1_import_get_derivatives(self._fmu, <FMIL.fmi1_real_t*>values.data, self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the derivative values at time: %E.'%self.time)
 * 
 */
  __pyx_t_7 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2564
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the derivative values at time: %E.'%self.time)             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_get_the_derivative_val, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __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_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2566
 *             raise FMUException('Failed to get the derivative values at time: %E.'%self.time)
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 *     def get_event_indicators(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":2543
 *     """)
 * 
 *     cpdef get_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the derivative of the continuous states.
 */

  /* function exit code */
  __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));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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 = __pyx_f_5pyfmi_3fmi_11FMUModelME1_get_derivatives(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2568
 *         return values
 * 
 *     def get_event_indicators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event indicators at the current time-point.
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":2584
 *         """
 *         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_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __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_From_unsigned_int(__pyx_v_self->__pyx_base._nEventIndicators); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __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 = 2584; __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 = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 2584; __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 = 2584; __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":2586
 *         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":2588
 *         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) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2589
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2589; __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 = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":2568
 *         return values
 * 
 *     def get_event_indicators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event indicators at the current time-point.
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2594
 * 
 * 
 *     def get_tolerances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the relative and absolute tolerances. If the relative tolerance
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":2615
 *         """
 *         #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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_tolerance); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_rtol = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2616
 *         #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_1 = PyNumber_Multiply(__pyx_float_0_01, __pyx_v_rtol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nominal_continuous_states); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __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":2618
 *         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 = 2618; __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 = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":2594
 * 
 * 
 *     def get_tolerances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the relative and absolute tolerances. If the relative tolerance
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2620
 *         return [rtol, atol]
 * 
 *     def event_update(self, intermediateResult=False):             # <<<<<<<<<<<<<<
 *         """
 *         Updates the event information at the current time-point. If
 */

/* 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("event_update (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_intermediateResult,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    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 = 2620; __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 = 2620; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_24event_update(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_intermediateResult) {
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_intermediate_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  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("event_update", 0);

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

    /* "pyfmi\fmi.pyx":2644
 * 
 *         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":2645
 *         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":2647
 *             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":2648
 *         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":2650
 *             status = FMIL.fmi1_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to update the events at time: %E.'%self.time)
 * 
 */
  __pyx_t_1 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2651
 * 
 *         if status != 0:
 *             raise FMUException('Failed to update the events at time: %E.'%self.time)             # <<<<<<<<<<<<<<
 * 
 *     def get_event_info(self):
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_update_the_events_at_t, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __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 = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2620
 *         return [rtol, atol]
 * 
 *     def event_update(self, intermediateResult=False):             # <<<<<<<<<<<<<<
 *         """
 *         Updates the event information at the current time-point. If
 */

  /* function exit code */
  __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_XDECREF(__pyx_t_6);
  __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;
}

/* "pyfmi\fmi.pyx":2653
 *             raise FMUException('Failed to update the events at time: %E.'%self.time)
 * 
 *     def get_event_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event information from the FMU.
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":2685
 *         """
 * 
 *         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 = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_iterationConverged, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

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

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

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

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

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

  /* "pyfmi\fmi.pyx":2653
 *             raise FMUException('Failed to update the events at time: %E.'%self.time)
 * 
 *     def get_event_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event information from the FMU.
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2694
 *         return self._pyEventInfo
 * 
 *     def get_state_value_references(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the continuous states valuereferences.
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":2710
 *         """
 *         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_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __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_From_unsigned_int(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __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 = 2710; __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 = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 2710; __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 = 2710; __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":2712
 *         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(             # <<<<<<<<<<<<<<
 *             self._fmu, <FMIL.fmi1_value_reference_t*>values.data, self._nContinuousStates)
 * 
 */
  __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":2715
 *             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) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2716
 * 
 *         if status != 0:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to get the continuous state reference values.')
 * 
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __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 = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":2694
 *         return self._pyEventInfo
 * 
 *     def get_state_value_references(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the continuous states valuereferences.
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2721
 *         return values
 * 
 *     def completed_integrator_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         This method must be called by the environment after every completed step
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":2737
 *         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":2739
 *         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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2740
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         if callEventUpdate == 1:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __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 = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2742
 *             raise FMUException('Failed to call FMI Completed Step.')
 * 
 *         if callEventUpdate == 1:             # <<<<<<<<<<<<<<
 *             return True
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_callEventUpdate == 1) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2743
 * 
 *         if callEventUpdate == 1:
 *             return True             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2745
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyfmi\fmi.pyx":2721
 *         return values
 * 
 *     def completed_integrator_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         This method must be called by the environment after every completed step
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":2748
 * 
 * 
 *     def initialize(self, tolControlled=True, relativeTolerance=None):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the model and computes initial values for all variables,
 */

/* 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tolControlled,&__pyx_n_s_relativeTolerance,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_True);
    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 = 2748; __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 = 2748; __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);

  /* function exit code */
  __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":2770
 * 
 *         #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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2771
 *         #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 = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

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

    /* "pyfmi\fmi.pyx":2774
 * 
 *         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":2775
 *         if tolControlled:
 *             tolerance_controlled = 1
 *             if relativeTolerance == None:             # <<<<<<<<<<<<<<
 *                 tolerance = FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)
 *             else:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_relativeTolerance, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

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

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

    /* "pyfmi\fmi.pyx":2781
 *         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":2783
 *             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":2785
 *         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) != 0);
  if (__pyx_t_3) {

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

      /* "pyfmi\fmi.pyx":2787
 *         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_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; __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_PyObject_Call(__pyx_t_1, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; __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":2791
 *                     ' 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_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; __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_PyObject_Call(__pyx_t_1, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; __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":2794
 *                     ' 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) != 0);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2795
 * 
 *         if status > 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException(
 *                     'Initialize returned with an error.' \
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._enable_logging); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":2796
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with an error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); 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_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2796; __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 = 2796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":2800
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Initialize returned with an error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__76, NULL); 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);
      __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 = 2800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

  /* "pyfmi\fmi.pyx":2803
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 *         self._allocated_fmu = 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base._allocated_fmu = 1;

  /* "pyfmi\fmi.pyx":2748
 * 
 * 
 *     def initialize(self, tolControlled=True, relativeTolerance=None):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the model and computes initial values for all variables,
 */

  /* function exit code */
  __pyx_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;
}

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

/* 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instantiate_model (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_logging,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s_Model);
    values[1] = ((PyObject *)Py_False);
    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 = 2806; __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 = 2806; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_34instantiate_model(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_logging) {
  fmi1_boolean_t __pyx_v_log;
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  fmi1_string_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("instantiate_model", 0);
  __Pyx_INCREF(__pyx_v_name);

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

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

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

  /* "pyfmi\fmi.pyx":2830
 *             log = 0
 * 
 *         name = encode(name)             # <<<<<<<<<<<<<<
 *         status = FMIL.fmi1_import_instantiate_model(self._fmu, name)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __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 = NULL;
    __Pyx_INCREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2);
  __pyx_t_2 = 0;

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

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

    /* "pyfmi\fmi.pyx":2834
 * 
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; __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 = 2834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":2838
 *         #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":2840
 *         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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2841
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_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 = 2841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* function exit code */
  __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.FMUModelME1.instantiate_model", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2843
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time="Default",
 *                  final_time="Default",
 */

/* 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start_time,&__pyx_n_s_final_time,&__pyx_n_s_input,&__pyx_n_s_algorithm,&__pyx_n_s_options,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_n_s_Default);
    values[1] = ((PyObject *)__pyx_n_s_Default);

    /* "pyfmi\fmi.pyx":2846
 *                  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__79;
    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 = 2843; __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 = 2843; __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);

  /* "pyfmi\fmi.pyx":2843
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time="Default",
 *                  final_time="Default",
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = 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":2910
 *             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, __pyx_n_s_Default, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2911
 *         """
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()             # <<<<<<<<<<<<<<
 *         if final_time == "Default":
 *             final_time = self.get_default_experiment_stop_time()
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_start_tim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_start_time, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

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

    /* "pyfmi\fmi.pyx":2913
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_stop_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_final_time, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

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

  /* "pyfmi\fmi.pyx":2920
 *                                              'pyfmi.fmi_algorithm_drivers',
 *                                              algorithm,
 *                                              options)             # <<<<<<<<<<<<<<
 * 
 *     def simulate_options(self, algorithm='AssimuloFMIAlg'):
 */
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(6+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_start_time);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start_time);
  __Pyx_GIVEREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_final_time);
  __Pyx_GIVEREF(__pyx_v_final_time);
  __Pyx_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_input);
  __Pyx_GIVEREF(__pyx_v_input);
  __Pyx_INCREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_GIVEREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_5, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_5, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); 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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":2843
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time="Default",
 *                  final_time="Default",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_39simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_38simulate_options[] = "\n        Get an instance of the simulate options class, filled with default\n        values. If called without argument then the options class for the\n        default simulation algorithm will be returned.\n\n        Parameters::\n\n            algorithm --\n                The algorithm for which the options class should be fetched.\n                Possible values are: 'AssimuloFMIAlg'.\n                Default: 'AssimuloFMIAlg'\n\n        Returns::\n\n            Options class for the algorithm specified with default values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_39simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_algorithm,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s_AssimuloFMIAlg);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_algorithm);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2922; __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 = 2922; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  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("simulate_options", 0);

  /* "pyfmi\fmi.pyx":2939
 *             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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default_options); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_GIVEREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2939; __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2941
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def terminate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the FMI function fmiTerminate() on the FMU.
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":2946
 *         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);

  /* "pyfmi\fmi.pyx":2941
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def terminate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the FMI function fmiTerminate() on the FMU.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2___init__[] = "\n        Constructor of the model.\n\n        Parameters::\n\n            fmu --\n                Name of the fmu as a string.\n\n            path --\n                Path to the fmu-directory.\n                Default: '.' (working directory)\n\n            enable_logging --\n                Boolean for acesss to logging-messages.\n                Default: True\n\n            log_file_name --\n                Filename for file used to save logmessages.\n                Default: \"\" (Generates automatically)\n\n        Returns::\n\n            A model as an object from the class FMUModelFMU2\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_13FMUModelBase2___init__;
#endif
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fmu,&__pyx_n_s_path,&__pyx_n_s_enable_logging,&__pyx_n_s_log_file_name,&__pyx_n_s_log_level,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s__10);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_kp_s__2);
    values[4] = __pyx_k__80;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_level);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __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 = 2954; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2___init__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name, __pyx_v_log_level);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level) {
  int __pyx_v_status;
  PyObject *__pyx_v_fmu_temp_dir = NULL;
  jm_string __pyx_v_last_error;
  PyObject *__pyx_v_fmu_log_name = NULL;
  PyObject *__pyx_v_file = NULL;
  Py_ssize_t __pyx_v_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  jm_log_level_enu_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  char *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  Py_ssize_t __pyx_t_18;
  PyObject *__pyx_t_19 = 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":2987
 * 
 *         #Contains the log information
 *         self._log               = []             # <<<<<<<<<<<<<<
 *         self._enable_logging    = enable_logging
 *         self._categories        = []
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_log);
  __Pyx_DECREF(__pyx_v_self->_log);
  __pyx_v_self->_log = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2988
 *         #Contains the log information
 *         self._log               = []
 *         self._enable_logging    = enable_logging             # <<<<<<<<<<<<<<
 *         self._categories        = []
 * 
 */
  __Pyx_INCREF(__pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __Pyx_GOTREF(__pyx_v_self->_enable_logging);
  __Pyx_DECREF(__pyx_v_self->_enable_logging);
  __pyx_v_self->_enable_logging = __pyx_v_enable_logging;

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

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

  /* "pyfmi\fmi.pyx":2993
 *         #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":2994
 *         self._allocated_context = 0
 *         self._allocated_dll = 0
 *         self._allocated_xml = 0             # <<<<<<<<<<<<<<
 *         self._allocated_fmu = 0
 *         self._fmu_temp_dir = NULL
 */
  __pyx_v_self->_allocated_xml = 0;

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

  /* "pyfmi\fmi.pyx":2996
 *         self._allocated_xml = 0
 *         self._allocated_fmu = 0
 *         self._fmu_temp_dir = NULL             # <<<<<<<<<<<<<<
 *         self._fmu_log_name = NULL
 * 
 */
  __pyx_v_self->_fmu_temp_dir = NULL;

  /* "pyfmi\fmi.pyx":2997
 *         self._allocated_fmu = 0
 *         self._fmu_temp_dir = NULL
 *         self._fmu_log_name = NULL             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_v_self->_fmu_log_name = NULL;

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

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

  /* "pyfmi\fmi.pyx":3002
 *         self.__t = None
 *         self._A = None
 *         self._B = None             # <<<<<<<<<<<<<<
 *         self._C = None
 *         self._D = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_B);
  __Pyx_DECREF(__pyx_v_self->_B);
  __pyx_v_self->_B = Py_None;

  /* "pyfmi\fmi.pyx":3003
 *         self._A = None
 *         self._B = None
 *         self._C = None             # <<<<<<<<<<<<<<
 *         self._D = None
 *         self._states_references = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_C);
  __Pyx_DECREF(__pyx_v_self->_C);
  __pyx_v_self->_C = Py_None;

  /* "pyfmi\fmi.pyx":3004
 *         self._B = None
 *         self._C = None
 *         self._D = None             # <<<<<<<<<<<<<<
 *         self._states_references = None
 *         self._derivatives_references = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_D);
  __Pyx_DECREF(__pyx_v_self->_D);
  __pyx_v_self->_D = Py_None;

  /* "pyfmi\fmi.pyx":3005
 *         self._C = None
 *         self._D = None
 *         self._states_references = None             # <<<<<<<<<<<<<<
 *         self._derivatives_references = None
 *         self._outputs_references = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_states_references);
  __Pyx_DECREF(__pyx_v_self->_states_references);
  __pyx_v_self->_states_references = Py_None;

  /* "pyfmi\fmi.pyx":3006
 *         self._D = None
 *         self._states_references = None
 *         self._derivatives_references = None             # <<<<<<<<<<<<<<
 *         self._outputs_references = None
 *         self._inputs_references = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_derivatives_references);
  __Pyx_DECREF(__pyx_v_self->_derivatives_references);
  __pyx_v_self->_derivatives_references = Py_None;

  /* "pyfmi\fmi.pyx":3007
 *         self._states_references = None
 *         self._derivatives_references = None
 *         self._outputs_references = None             # <<<<<<<<<<<<<<
 *         self._inputs_references = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_outputs_references);
  __Pyx_DECREF(__pyx_v_self->_outputs_references);
  __pyx_v_self->_outputs_references = Py_None;

  /* "pyfmi\fmi.pyx":3008
 *         self._derivatives_references = None
 *         self._outputs_references = None
 *         self._inputs_references = None             # <<<<<<<<<<<<<<
 * 
 *         #Internal values
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_inputs_references);
  __Pyx_DECREF(__pyx_v_self->_inputs_references);
  __pyx_v_self->_inputs_references = Py_None;

  /* "pyfmi\fmi.pyx":3011
 * 
 *         #Internal values
 *         self._pyEventInfo = PyEventInfo()             # <<<<<<<<<<<<<<
 * 
 *         #Specify the general callback functions
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PyEventInfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_pyEventInfo);
  __Pyx_DECREF(__pyx_v_self->_pyEventInfo);
  __pyx_v_self->_pyEventInfo = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3014
 * 
 *         #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":3015
 *         #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":3016
 *         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":3017
 *         self.callbacks.calloc           = FMIL.calloc
 *         self.callbacks.realloc          = FMIL.realloc
 *         self.callbacks.free             = FMIL.free             # <<<<<<<<<<<<<<
 *         self.callbacks.logger           = importlogger2
 *         self.callbacks.context          = <void*> self
 */
  __pyx_v_self->callbacks.free = free;

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

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

  /* "pyfmi\fmi.pyx":3022
 * 
 *         #Specify FMI2 related callbacks
 *         self.callBackFunctions.logger               = FMIL.fmi2_log_forwarding             # <<<<<<<<<<<<<<
 *         #self.callBackFunctions.logger               = importlogger_fmi2
 *         #self.callBackFunctions.logger               = FMIL.fmi2_default_callback_logger
 */
  __pyx_v_self->callBackFunctions.logger = fmi2_log_forwarding;

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

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

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

  /* "pyfmi\fmi.pyx":3028
 *         self.callBackFunctions.freeMemory           = FMIL.free
 *         self.callBackFunctions.stepFinished         = NULL
 *         self.callBackFunctions.componentEnvironment = NULL             # <<<<<<<<<<<<<<
 * 
 *         if enable_logging==None:
 */
  __pyx_v_self->callBackFunctions.componentEnvironment = NULL;

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

    /* "pyfmi\fmi.pyx":3031
 * 
 *         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 = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = PyInt_FromLong(jm_log_level_all); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_4) {

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

        /* "pyfmi\fmi.pyx":3033
 *             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_INCREF(Py_False);
        __Pyx_DECREF_SET(__pyx_v_enable_logging, Py_False);
        goto __pyx_L7;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":3035
 *                     enable_logging = False
 *                 else:
 *                     enable_logging = True             # <<<<<<<<<<<<<<
 *                 self.callbacks.log_level = log_level
 *             else:
 */
        __Pyx_INCREF(Py_True);
        __Pyx_DECREF_SET(__pyx_v_enable_logging, Py_True);
      }
      __pyx_L7:;

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

      /* "pyfmi\fmi.pyx":3038
 *                 self.callbacks.log_level = log_level
 *             else:
 *                 raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))             # <<<<<<<<<<<<<<
 *         else:
 *             logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PyInt_FromLong(jm_log_level_all); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __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 = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_3 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_The_log_level_must_be_between_d, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __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_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 = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3040
 *                 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3040; __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_PyObject_Call(__pyx_t_1, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3040; __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":3041
 *         else:
 *             logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")
 *             self.callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error             # <<<<<<<<<<<<<<
 * 
 *         # Check that the file referenced by fmu has the correct file-ending
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {
      __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":3044
 * 
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu.endswith('.fmu'):             # <<<<<<<<<<<<<<
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmu, __pyx_n_s_endswith); 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_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_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 = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":3045
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu.endswith('.fmu'):
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *         #Check that the file exists
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); 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_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__83, NULL); 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_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 = 3045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3048
 * 
 *         #Check that the file exists
 *         self._fmu_full_path = encode(os.path.abspath(os.path.join(path,fmu)))             # <<<<<<<<<<<<<<
 *         if not os.path.isfile(self._fmu_full_path):
 *             raise FMUException('Could not locate the FMU in the specified directory.')
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_abspath); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_path); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_join); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = NULL;
  __pyx_t_11 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_11 = 1;
    }
  }
  __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (__pyx_t_10) {
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
  }
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_9) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
    PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
    PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_fmu_full_path);
  __Pyx_DECREF(__pyx_v_self->_fmu_full_path);
  __pyx_v_self->_fmu_full_path = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3049
 *         #Check that the file exists
 *         self._fmu_full_path = encode(os.path.abspath(os.path.join(path,fmu)))
 *         if not os.path.isfile(self._fmu_full_path):             # <<<<<<<<<<<<<<
 *             raise FMUException('Could not locate the FMU in the specified directory.')
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_isfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_12) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_self->_fmu_full_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL;
    __Pyx_INCREF(__pyx_v_self->_fmu_full_path);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_self->_fmu_full_path);
    __Pyx_GIVEREF(__pyx_v_self->_fmu_full_path);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __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_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_5) != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":3050
 *         self._fmu_full_path = encode(os.path.abspath(os.path.join(path,fmu)))
 *         if not os.path.isfile(self._fmu_full_path):
 *             raise FMUException('Could not locate the FMU in the specified directory.')             # <<<<<<<<<<<<<<
 * 
 *         # Create a struct for allocation
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__84, 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_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 = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":3054
 *         # Create a struct for allocation
 *         self._context           = FMIL.fmi_import_allocate_context(&self.callbacks)
 *         self._allocated_context = 1             # <<<<<<<<<<<<<<
 * 
 *         #Get the FMI version of the provided model
 */
  __pyx_v_self->_allocated_context = 1;

  /* "pyfmi\fmi.pyx":3057
 * 
 *         #Get the FMI version of the provided model
 *         fmu_temp_dir  = encode(create_temp_dir())             # <<<<<<<<<<<<<<
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_temp_dir, fmu_temp_dir)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_create_temp_dir); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
    }
  }
  if (__pyx_t_7) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_12) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL;
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_fmu_temp_dir = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3058
 *         #Get the FMI version of the provided model
 *         fmu_temp_dir  = encode(create_temp_dir())
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))             # <<<<<<<<<<<<<<
 *         FMIL.strcpy(self._fmu_temp_dir, fmu_temp_dir)
 *         self._version      = FMIL.fmi_import_get_fmi_version(self._context, self._fmu_full_path, self._fmu_temp_dir)
 */
  __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_fmu_temp_dir = ((char *)malloc(((strlen(__pyx_t_13) + 1) * (sizeof(char)))));

  /* "pyfmi\fmi.pyx":3059
 *         fmu_temp_dir  = encode(create_temp_dir())
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_temp_dir, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *         self._version      = FMIL.fmi_import_get_fmi_version(self._context, self._fmu_full_path, self._fmu_temp_dir)
 * 
 */
  __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_self->_fmu_temp_dir, __pyx_t_13);

  /* "pyfmi\fmi.pyx":3060
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_temp_dir, fmu_temp_dir)
 *         self._version      = FMIL.fmi_import_get_fmi_version(self._context, self._fmu_full_path, self._fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *         #Check the version
 */
  __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_self->_fmu_full_path); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_version = fmi_import_get_fmi_version(__pyx_v_self->_context, __pyx_t_13, __pyx_v_self->_fmu_temp_dir);

  /* "pyfmi\fmi.pyx":3063
 * 
 *         #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) != 0);
  if (__pyx_t_4) {

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

      /* "pyfmi\fmi.pyx":3066
 *             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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = PyNumber_Add(__pyx_kp_s_The_FMU_version_could_not_be_det, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
        PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __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 = 3066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3068
 *                 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3068; __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 = 3068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

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

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

      /* "pyfmi\fmi.pyx":3073
 *             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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_3 = PyNumber_Add(__pyx_kp_s_The_FMU_version_is_not_supported, __pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_12) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL;
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __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 = 3073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

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

  /* "pyfmi\fmi.pyx":3078
 * 
 *         #Parse xml and check fmu-kind
 *         self._fmu           = FMIL.fmi2_import_parse_xml(self._context, self._fmu_temp_dir, NULL)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu is NULL:
 */
  __pyx_v_self->_fmu = fmi2_import_parse_xml(__pyx_v_self->_context, __pyx_v_self->_fmu_temp_dir, NULL);

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

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

      /* "pyfmi\fmi.pyx":3083
 *             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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = PyNumber_Add(__pyx_kp_s_The_XML_could_not_be_read, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
        PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __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 = 3083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3085
 *                 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_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 = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

  /* "pyfmi\fmi.pyx":3087
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')
 * 
 *         self.callBackFunctions.componentEnvironment = <FMIL.fmi2_component_environment_t>self._fmu             # <<<<<<<<<<<<<<
 *         #self.callBackFunctions.componentEnvironment = <FMIL.fmi2_component_environment_t>self
 *         self._fmu_kind      = FMIL.fmi2_import_get_fmu_kind(self._fmu)
 */
  __pyx_v_self->callBackFunctions.componentEnvironment = ((fmi2_component_environment_t)__pyx_v_self->_fmu);

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

  /* "pyfmi\fmi.pyx":3090
 *         #self.callBackFunctions.componentEnvironment = <FMIL.fmi2_component_environment_t>self
 *         self._fmu_kind      = FMIL.fmi2_import_get_fmu_kind(self._fmu)
 *         self._allocated_xml = 1             # <<<<<<<<<<<<<<
 * 
 *         #FMU kind is unknown
 */
  __pyx_v_self->_allocated_xml = 1;

  /* "pyfmi\fmi.pyx":3099
 *             else:
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")
 *         elif self._fmu_kind == FMIL.fmi2_fmu_kind_me_and_cs:             # <<<<<<<<<<<<<<
 *             if isinstance(self,FMUModelME2):
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_me
 */
  switch (__pyx_v_self->_fmu_kind) {

    /* "pyfmi\fmi.pyx":3093
 * 
 *         #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:
 */
    case fmi2_fmu_kind_unknown:

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

      /* "pyfmi\fmi.pyx":3096
 *             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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_3 = PyNumber_Add(__pyx_kp_s_The_FMU_kind_could_not_be_determ, __pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_12) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL;
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __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 = 3096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3098
 *                 raise FMUException("The FMU kind could not be determined. "+last_error)
 *             else:
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         elif self._fmu_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *             if isinstance(self,FMUModelME2):
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3098; __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 = 3098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    break;

    /* "pyfmi\fmi.pyx":3099
 *             else:
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")
 *         elif self._fmu_kind == FMIL.fmi2_fmu_kind_me_and_cs:             # <<<<<<<<<<<<<<
 *             if isinstance(self,FMUModelME2):
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_me
 */
    case fmi2_fmu_kind_me_and_cs:

    /* "pyfmi\fmi.pyx":3100
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")
 *         elif self._fmu_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *             if isinstance(self,FMUModelME2):             # <<<<<<<<<<<<<<
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_me
 *             elif isinstance(self,FMUModelCS2):
 */
    __pyx_t_4 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), ((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME2)); 
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3101
 *         elif self._fmu_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *             if isinstance(self,FMUModelME2):
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_me             # <<<<<<<<<<<<<<
 *             elif isinstance(self,FMUModelCS2):
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_cs
 */
      __pyx_v_self->_fmu_kind = fmi2_fmu_kind_me;
      goto __pyx_L17;
    }

    /* "pyfmi\fmi.pyx":3102
 *             if isinstance(self,FMUModelME2):
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_me
 *             elif isinstance(self,FMUModelCS2):             # <<<<<<<<<<<<<<
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_cs
 *             else:
 */
    __pyx_t_5 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), ((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2)); 
    __pyx_t_4 = (__pyx_t_5 != 0);
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":3103
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_me
 *             elif isinstance(self,FMUModelCS2):
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_cs             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("FMUModelBase2 cannot be used directly, use FMUModelME2 or FMUModelCS2.")
 */
      __pyx_v_self->_fmu_kind = fmi2_fmu_kind_cs;
      goto __pyx_L17;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3105
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_cs
 *             else:
 *                 raise FMUException("FMUModelBase2 cannot be used directly, use FMUModelME2 or FMUModelCS2.")             # <<<<<<<<<<<<<<
 * 
 *         #Connect the DLL
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3105; __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 = 3105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L17:;
    break;
    default: break;
  }

  /* "pyfmi\fmi.pyx":3108
 * 
 *         #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":3109
 *         #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) != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":3110
 *         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("Error loading the binary. " + last_error)
 */
    __pyx_v_last_error = fmi2_import_get_last_error(__pyx_v_self->_fmu);

    /* "pyfmi\fmi.pyx":3111
 *         if status == FMIL.jm_status_error:
 *             last_error = FMIL.fmi2_import_get_last_error(self._fmu)
 *             if enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException("Error loading the binary. " + 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 = 3111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":3112
 *             last_error = FMIL.fmi2_import_get_last_error(self._fmu)
 *             if enable_logging:
 *                 raise FMUException("Error loading the binary. " + last_error)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Error_loading_the_binary, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
        PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __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 = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3114
 *                 raise FMUException("Error loading the binary. " + last_error)
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         self._allocated_dll = 1
 * 
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); 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_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__90, NULL); 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_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

  /* "pyfmi\fmi.pyx":3115
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")
 *         self._allocated_dll = 1             # <<<<<<<<<<<<<<
 * 
 *         #Load information from model
 */
  __pyx_v_self->_allocated_dll = 1;

  /* "pyfmi\fmi.pyx":3118
 * 
 *         #Load information from model
 *         self._modelName         = decode(FMIL.fmi2_import_get_model_name(self._fmu))             # <<<<<<<<<<<<<<
 *         self._nEventIndicators  = FMIL.fmi2_import_get_number_of_event_indicators(self._fmu)
 *         self._nContinuousStates = FMIL.fmi2_import_get_number_of_continuous_states(self._fmu)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_12 = __Pyx_PyBytes_FromString(fmi2_import_get_model_name(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_modelName);
  __Pyx_DECREF(__pyx_v_self->_modelName);
  __pyx_v_self->_modelName = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3119
 *         #Load information from model
 *         self._modelName         = decode(FMIL.fmi2_import_get_model_name(self._fmu))
 *         self._nEventIndicators  = FMIL.fmi2_import_get_number_of_event_indicators(self._fmu)             # <<<<<<<<<<<<<<
 *         self._nContinuousStates = FMIL.fmi2_import_get_number_of_continuous_states(self._fmu)
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)
 */
  __pyx_v_self->_nEventIndicators = fmi2_import_get_number_of_event_indicators(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3120
 *         self._modelName         = decode(FMIL.fmi2_import_get_model_name(self._fmu))
 *         self._nEventIndicators  = FMIL.fmi2_import_get_number_of_event_indicators(self._fmu)
 *         self._nContinuousStates = FMIL.fmi2_import_get_number_of_continuous_states(self._fmu)             # <<<<<<<<<<<<<<
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)
 *         fmu_log_name = encode((self._modelName + "_log.txt") if log_file_name=="" else log_file_name)
 */
  __pyx_v_self->_nContinuousStates = fmi2_import_get_number_of_continuous_states(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3121
 *         self._nEventIndicators  = FMIL.fmi2_import_get_number_of_event_indicators(self._fmu)
 *         self._nContinuousStates = FMIL.fmi2_import_get_number_of_continuous_states(self._fmu)
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)             # <<<<<<<<<<<<<<
 *         fmu_log_name = encode((self._modelName + "_log.txt") if log_file_name=="" else log_file_name)
 *         self._fmu_log_name = <char*>FMIL.malloc((FMIL.strlen(fmu_log_name)+1)*sizeof(char))
 */
  __pyx_v_self->_nCategories = fmi2_import_get_log_categories_num(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3122
 *         self._nContinuousStates = FMIL.fmi2_import_get_number_of_continuous_states(self._fmu)
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)
 *         fmu_log_name = encode((self._modelName + "_log.txt") if log_file_name=="" else log_file_name)             # <<<<<<<<<<<<<<
 *         self._fmu_log_name = <char*>FMIL.malloc((FMIL.strlen(fmu_log_name)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_log_name, fmu_log_name)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_log_file_name, __pyx_kp_s__2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __pyx_t_12 = PyNumber_Add(__pyx_v_self->_modelName, __pyx_kp_s_log_txt); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_7 = __pyx_t_12;
    __pyx_t_12 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_log_file_name);
    __pyx_t_7 = __pyx_v_log_file_name;
  }
  __pyx_t_12 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_12) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL;
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3122; __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_v_fmu_log_name = __pyx_t_1;
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":3127
 * 
 *         #Create the log file
 *         with open(self._fmu_log_name,'w') as file:             # <<<<<<<<<<<<<<
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 */
  /*with:*/ {
    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __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 = 3127; __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_INCREF(__pyx_n_s_w);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_w);
    __Pyx_GIVEREF(__pyx_n_s_w);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_14 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L20_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L20_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L20_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
        __Pyx_XGOTREF(__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_16);
        __Pyx_XGOTREF(__pyx_t_17);
        /*try:*/ {
          __pyx_v_file = __pyx_t_3;
          __pyx_t_3 = 0;

          /* "pyfmi\fmi.pyx":3128
 *         #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 = __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 = 3128; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
          }
          __pyx_t_11 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3128; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_11; __pyx_t_18+=1) {
            __pyx_v_i = __pyx_t_18;

            /* "pyfmi\fmi.pyx":3129
 *         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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_1);
            if (unlikely(__pyx_v_self->_log == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            }
            __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->_log, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;};
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;};
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(__pyx_v_self->_log == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            }
            __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->_log, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;};
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;};
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(__pyx_v_self->_log == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            }
            __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->_log, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;};
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;};
            __Pyx_GOTREF(__pyx_t_8);
            __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 = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12);
            __Pyx_GIVEREF(__pyx_t_12);
            PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_8);
            __pyx_t_7 = 0;
            __pyx_t_12 = 0;
            __pyx_t_8 = 0;
            __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_FMIL_module_s_log_level_d_s, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
              }
            }
            if (!__pyx_t_2) {
              __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_GOTREF(__pyx_t_3);
            } else {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              __Pyx_GOTREF(__pyx_t_12);
              PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_8);
              __Pyx_GIVEREF(__pyx_t_8);
              __pyx_t_8 = 0;
              __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3129; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }

          /* "pyfmi\fmi.pyx":3130
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 *             self._log = []             # <<<<<<<<<<<<<<
 * 
 *     def get_real(self, valueref):
 */
          __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_v_self->_log);
          __Pyx_DECREF(__pyx_v_self->_log);
          __pyx_v_self->_log = ((PyObject*)__pyx_t_3);
          __pyx_t_3 = 0;
        }
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        goto __pyx_L31_try_end;
        __pyx_L24_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "pyfmi\fmi.pyx":3127
 * 
 *         #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_3, &__pyx_t_1, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_8 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_8, NULL);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __Pyx_GOTREF(__pyx_t_19);
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          if (__pyx_t_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ErrRestore(__pyx_t_3, __pyx_t_1, __pyx_t_12);
            __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_12 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L25_exception_handled;
        }
        __pyx_L26_except_error:;
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
        goto __pyx_L1_error;
        __pyx_L25_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
        __pyx_L31_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_14) {
          __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__91, NULL);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        }
        goto __pyx_L23;
      }
      __pyx_L23:;
    }
    goto __pyx_L37;
    __pyx_L20_error:;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    goto __pyx_L1_error;
    __pyx_L37:;
  }

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

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmu_temp_dir);
  __Pyx_XDECREF(__pyx_v_fmu_log_name);
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF(__pyx_v_enable_logging);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3132
 *             self._log = []
 * 
 *     def get_real(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the real-values from the valuereference(s).
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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":3156
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __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 = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.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_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __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_7 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":3158
 *         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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __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_float_0_0);
      PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_float_0_0);
      __Pyx_GIVEREF(__pyx_float_0_0);
    }
  }
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __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_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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 = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output_value.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__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 = 3158; __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_9 = 0;
  __pyx_v_output_value = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

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

    /* "pyfmi\fmi.pyx":3163
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3163; __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 = 3163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":3132
 *             self._log = []
 * 
 *     def get_real(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the real-values from the valuereference(s).
 */

  /* function exit code */
  __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_6);
  { 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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_5set_real(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_4set_real[] = "\n        Sets the real-values in the FMU as defined by the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n            values --\n                Values to be set.\n\n        Example::\n\n            model.set_real([234,235],[2.34,10.4])\n\n        Calls the low-level FMI function: fmi2SetReal\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_5set_real(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_real (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_valueref,&__pyx_n_s_values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_real", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3167; __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 = 3167; __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 = 3167; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  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":3188
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __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 = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.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_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __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_7 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3189
 * 
 *         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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__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 = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_set_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_set_value = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_set_value.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __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_8 = 0;
  __pyx_v_set_value = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

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

    /* "pyfmi\fmi.pyx":3194
 * 
 *         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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3194; __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 = 3194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3196
 *             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":3198
 *         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_11 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_11) {

    /* "pyfmi\fmi.pyx":3199
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3199; __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 = 3199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* function exit code */
  __pyx_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_6);
  { 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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_7get_integer(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_6get_integer[] = "\n        Returns the integer-values from the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n        Returns::\n\n            values --\n                The values retrieved from the FMU.\n\n        Example::\n\n            val = model.get_integer([232])\n\n        Calls the low-level FMI function: fmi2GetInteger\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_7get_integer(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_integer (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_6get_integer(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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":3224
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __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 = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.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_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __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_7 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":3226
 *         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_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __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_int_0);
      PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
    }
  }
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __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_6); __pyx_t_6 = 0;
  __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 = 3226; __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_output_value.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__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 = 3226; __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_9 = 0;
  __pyx_v_output_value = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

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

    /* "pyfmi\fmi.pyx":3232
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_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 = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

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

  /* function exit code */
  __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_6);
  { 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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_9set_integer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_8set_integer[] = "\n        Sets the integer-values in the FMU as defined by the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n            values --\n                Values to be set.\n\n        Example::\n\n            model.set_integer([234,235],[12,-3])\n\n        Calls the low-level FMI function: fmi2SetInteger\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_9set_integer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_integer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_valueref,&__pyx_n_s_values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_integer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3236; __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 = 3236; __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 = 3236; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  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":3257
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __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 = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.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_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __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_7 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3258
 * 
 *         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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_int); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__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 = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_set_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_set_value = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_set_value.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __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_8 = 0;
  __pyx_v_set_value = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

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

    /* "pyfmi\fmi.pyx":3263
 * 
 *         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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __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 = 3263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3265
 *             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":3267
 *         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_11 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_11) {

    /* "pyfmi\fmi.pyx":3268
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_boolean(self, valueref):
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __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 = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* function exit code */
  __pyx_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_6);
  { 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;
}

/* "pyfmi\fmi.pyx":3270
 *             raise FMUException('Failed to set the Integer values.')
 * 
 *     def get_boolean(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the boolean-values from the valuereference(s).
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  size_t __pyx_t_9;
  size_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  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":3293
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __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 = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.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_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __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_7 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":3297
 * 
 *         #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":3301
 * 
 *         #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":3303
 *         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_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_return_values = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3304
 * 
 *         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_9 = __pyx_v_nref;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "pyfmi\fmi.pyx":3305
 *         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_1 = __Pyx_PyBool_FromLong(((((fmi2_boolean_t *)__pyx_v_output_value)[__pyx_v_i]) == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_return_values, __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

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

    /* "pyfmi\fmi.pyx":3314
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         #return val==FMI_TRUE
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __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 = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3317
 * 
 *         #return val==FMI_TRUE
 *         return N.array(return_values)             # <<<<<<<<<<<<<<
 * 
 *     def set_boolean(self, valueref, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_return_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_return_values);
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_return_values);
    __Pyx_GIVEREF(__pyx_v_return_values);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":3270
 *             raise FMUException('Failed to set the Integer values.')
 * 
 *     def get_boolean(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the boolean-values from the valuereference(s).
 */

  /* function exit code */
  __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_6);
  { 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;
}

/* "pyfmi\fmi.pyx":3319
 *         return N.array(return_values)
 * 
 *     def set_boolean(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the boolean-values in the FMU as defined by the valuereference(s).
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13set_boolean(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_12set_boolean[] = "\n        Sets the boolean-values in the FMU as defined by the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n            values --\n                Values to be set.\n\n        Example::\n\n            model.set_boolean([234,235],[True,False])\n\n        Calls the low-level FMI function: fmi2SetBoolean\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13set_boolean(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_boolean (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_valueref,&__pyx_n_s_values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_boolean", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __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 = 3319; __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 = 3319; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  size_t __pyx_t_9;
  size_t __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  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":3340
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __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 = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.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_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __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_7 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":3344
 * 
 *         #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":3346
 *         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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __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 = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_2 = PyDict_New(); 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);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flatten); 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);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_1);
  __pyx_t_1 = 0;

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

    /* "pyfmi\fmi.pyx":3348
 *         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_1 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_i, size_t, 0, __Pyx_PyInt_From_size_t, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3348; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_11) {

      /* "pyfmi\fmi.pyx":3350
 *             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":3353
 *             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":3355
 *                 (<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_8 = PyObject_Length(((PyObject *)__pyx_v_input_valueref)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((__pyx_t_8 != __pyx_t_12) != 0);
  if (__pyx_t_11) {

    /* "pyfmi\fmi.pyx":3356
 * 
 *         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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__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 = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3359
 * 
 *         #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":3361
 *         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":3363
 *         FMIL.free(set_value)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Boolean values.')
 * 
 */
  __pyx_t_11 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_11) {

    /* "pyfmi\fmi.pyx":3364
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3364; __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 = 3364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3319
 *         return N.array(return_values)
 * 
 *     def set_boolean(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the boolean-values in the FMU as defined by the valuereference(s).
 */

  /* function exit code */
  __pyx_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_6);
  { 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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":3387
 *         """
 * 
 *         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 = 3387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_17set_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_16set_string[] = "\n        Sets the string-values in the FMU as defined by the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n            values --\n                Values to be set.\n\n        Example::\n\n            model.set_string([234,235],['text','text'])\n\n        Calls the low-level FMI function: fmi2SetString\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_17set_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_valueref = 0;
  CYTHON_UNUSED PyObject *__pyx_v_values = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_valueref,&__pyx_n_s_values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_string", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __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 = 3403; __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 = 3403; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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":3421
 *         Calls the low-level FMI function: fmi2SetString
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 *         cdef int         status
 *         cdef FMIL.size_t nref
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3438
 *             raise FMUException('Failed to set the String values.')
 * 
 *     def _set(self, variable_name, value):             # <<<<<<<<<<<<<<
 *         """
 *         Helper method to set, see docstring on set.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_19_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_18_set[] = "\n        Helper method to set, see docstring on set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_19_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variable_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_variable_name,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_variable_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3438; __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 = 3438; __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 = 3438; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_18_set(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_value) {
  fmi2_value_reference_t __pyx_v_ref;
  fmi2_base_type_enu_t __pyx_v_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_value_reference_t __pyx_t_1;
  fmi2_base_type_enu_t __pyx_t_2;
  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;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set", 0);

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

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

  /* "pyfmi\fmi.pyx":3454
 *         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:
 */
  switch (__pyx_v_type) {

    /* "pyfmi\fmi.pyx":3448
 *         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
 */
    case fmi2_base_type_real:

    /* "pyfmi\fmi.pyx":3449
 * 
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_real); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __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 = 3449; __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 = 3449; __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 = 3449; __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 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_7) {
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_6 = 0;
    __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    break;

    /* "pyfmi\fmi.pyx":3450
 *         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
 */
    case fmi2_base_type_int:

    /* "pyfmi\fmi.pyx":3451
 *             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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_9, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_6) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_5 = 0;
    __pyx_t_9 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    break;

    /* "pyfmi\fmi.pyx":3452
 *         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
 */
    case fmi2_base_type_str:

    /* "pyfmi\fmi.pyx":3453
 *             self.set_integer([ref], [value])
 *         elif type == FMIL.fmi2_base_type_str: #STRING
 *             self.set_string([ref], [value])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi2_base_type_bool: #BOOLEAN
 *             self.set_boolean([ref], [value])
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_string); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyList_SET_ITEM(__pyx_t_9, 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 = 3453; __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_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_9 = 0;
    __pyx_t_7 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); 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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    break;

    /* "pyfmi\fmi.pyx":3454
 *         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:
 */
    case fmi2_base_type_bool:

    /* "pyfmi\fmi.pyx":3455
 *             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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_boolean); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __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_9 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_9) {
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_7 = 0;
    __pyx_t_6 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    break;
    default:

    /* "pyfmi\fmi.pyx":3457
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     def _get(self, variable_name):
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3457; __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 = 3457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

  /* "pyfmi\fmi.pyx":3438
 *             raise FMUException('Failed to set the String values.')
 * 
 *     def _set(self, variable_name, value):             # <<<<<<<<<<<<<<
 *         """
 *         Helper method to set, see docstring on set.
 */

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3459
 *             raise FMUException('Type not supported.')
 * 
 *     def _get(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Helper method to get, see docstring on get.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_21_get(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_20_get[] = "\n        Helper method to get, see docstring on get.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_21_get(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_20_get(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_20_get(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  fmi2_value_reference_t __pyx_v_ref;
  fmi2_base_type_enu_t __pyx_v_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_value_reference_t __pyx_t_1;
  fmi2_base_type_enu_t __pyx_t_2;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get", 0);

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

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

  /* "pyfmi\fmi.pyx":3475
 *         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:
 */
  switch (__pyx_v_type) {

    /* "pyfmi\fmi.pyx":3469
 *         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
 */
    case fmi2_base_type_real:

    /* "pyfmi\fmi.pyx":3470
 * 
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_real); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __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 = 3470; __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 = 3470; __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 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":3471
 *         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
 */
    case fmi2_base_type_int:

    /* "pyfmi\fmi.pyx":3472
 *             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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3472; __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_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":3473
 *         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
 */
    case fmi2_base_type_str:

    /* "pyfmi\fmi.pyx":3474
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_string); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __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 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":3475
 *         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:
 */
    case fmi2_base_type_bool:

    /* "pyfmi\fmi.pyx":3476
 *             return self.get_string([ref])
 *         elif type == FMIL.fmi2_base_type_bool: #BOOLEAN
 *             return self.get_boolean([ref])             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Type not supported.')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_boolean); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3476; __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_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    break;
    default:

    /* "pyfmi\fmi.pyx":3478
 *             return self.get_boolean([ref])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __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 = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

  /* "pyfmi\fmi.pyx":3459
 *             raise FMUException('Type not supported.')
 * 
 *     def _get(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Helper method to get, see docstring on get.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

    /* "pyfmi\fmi.pyx":3482
 *     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 = __Pyx_PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __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_INCREF(__pyx_n_s_a);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_a);
      __Pyx_GIVEREF(__pyx_n_s_a);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          /*try:*/ {
            __pyx_v_file = __pyx_t_5;
            __pyx_t_5 = 0;

            /* "pyfmi\fmi.pyx":3483
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_module); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_log_level); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_10 = __Pyx_PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_6);
            PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_10);
            __pyx_t_3 = 0;
            __pyx_t_6 = 0;
            __pyx_t_10 = 0;
            __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_FMIL_module_s_log_level_d_s, __pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_11)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_11);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
              }
            }
            if (!__pyx_t_11) {
              __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_GOTREF(__pyx_t_5);
            } else {
              __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_6);
              PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
              PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_10);
              __Pyx_GIVEREF(__pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L15_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "pyfmi\fmi.pyx":3482
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:             # <<<<<<<<<<<<<<
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 */
          /*except:*/ {
            __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._logger", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_10 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (__pyx_t_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __pyx_t_13 = ((!(__pyx_t_1 != 0)) != 0);
            if (__pyx_t_13) {
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_XGIVEREF(__pyx_t_6);
              __Pyx_ErrRestore(__pyx_t_5, __pyx_t_2, __pyx_t_6);
              __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_6 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          __pyx_L15_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_4) {
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__103, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3485
 *                 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(__pyx_v_self->_log == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_module); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_log_level); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = PyList_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_10, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_6 = 0;
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_self->_log, __pyx_t_10); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_L3:;

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

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  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("get_log", 0);

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

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

    /* "pyfmi\fmi.pyx":3502
 *         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 = __Pyx_PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __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 = 3502; __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_INCREF(__pyx_n_s_r);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_r);
      __Pyx_GIVEREF(__pyx_n_s_r);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __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_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      /*try:*/ {
        {
          __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          /*try:*/ {
            __pyx_v_file = __pyx_t_5;
            __pyx_t_5 = 0;

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

              /* "pyfmi\fmi.pyx":3504
 *             with open(self._fmu_log_name,'r') as file:
 *                 while True:
 *                     line = file.readline()             # <<<<<<<<<<<<<<
 *                     if line == "":
 *                         break
 */
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_readline); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3504; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_3 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
                __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
                if (likely(__pyx_t_3)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                  __Pyx_INCREF(__pyx_t_3);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_1, function);
                }
              }
              if (__pyx_t_3) {
                __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3504; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              } else {
                __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3504; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              }
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_5);
              __pyx_t_5 = 0;

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

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

              /* "pyfmi\fmi.pyx":3507
 *                     if line == "":
 *                         break
 *                     log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 *         return log
 * 
 */
              __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3507; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3507; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_log, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3507; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            }
            __pyx_L17_break:;
          }
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L15_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "pyfmi\fmi.pyx":3502
 *         log = []
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     line = file.readline()
 */
          /*except:*/ {
            __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_log", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __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 (__pyx_t_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __pyx_t_12 = ((!(__pyx_t_2 != 0)) != 0);
            if (__pyx_t_12) {
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_XGIVEREF(__pyx_t_3);
              __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_3);
              __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_3 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          __pyx_L15_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_4) {
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__105, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L22;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L22:;
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3508
 *                         break
 *                     log.append(line.strip("\n"))
 *         return log             # <<<<<<<<<<<<<<
 * 
 *     def print_log(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_log);
  __pyx_r = __pyx_v_log;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.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;
}

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

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":3515
 *         """
 *         cdef int N
 *         log = self.get_log()             # <<<<<<<<<<<<<<
 *         N = len(log)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_log); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_log = __pyx_t_1;
  __pyx_t_1 = 0;

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

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

    /* "pyfmi\fmi.pyx":3519
 * 
 *         for i in range(N):
 *             print log[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_log, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3519; __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 = 3519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

  /* function exit code */
  __pyx_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.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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_27instantiate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_26instantiate[] = "\n        Instantiate the model.\n\n        Parameters::\n\n            name --\n                The name of the instance.\n                Default: 'Model'\n\n            visible --\n                Defines if the simulator application window should be visible or not.\n                Default: False, not visible.\n\n        Calls the low-level FMI function: fmi2Instantiate.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_27instantiate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_visible = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instantiate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_visible,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s_Model);
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_visible);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "instantiate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3522; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_visible = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("instantiate", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3522; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.instantiate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_26instantiate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_name, __pyx_v_visible);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_26instantiate(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_visible) {
  fmi2_boolean_t __pyx_v_vis;
  int __pyx_v_status;
  fmi2_type_t __pyx_v_fmuType;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  fmi2_string_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("instantiate", 0);
  __Pyx_INCREF(__pyx_v_name);

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

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

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

  /* "pyfmi\fmi.pyx":3548
 *             vis = 0
 * 
 *         if isinstance(self,FMUModelME2):             # <<<<<<<<<<<<<<
 *             fmuType = FMIL.fmi2_model_exchange
 *         elif isinstance(self,FMUModelCS2):
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), ((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME2)); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3549
 * 
 *         if isinstance(self,FMUModelME2):
 *             fmuType = FMIL.fmi2_model_exchange             # <<<<<<<<<<<<<<
 *         elif isinstance(self,FMUModelCS2):
 *             fmuType = FMIL.fmi2_cosimulation
 */
    __pyx_v_fmuType = fmi2_model_exchange;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":3550
 *         if isinstance(self,FMUModelME2):
 *             fmuType = FMIL.fmi2_model_exchange
 *         elif isinstance(self,FMUModelCS2):             # <<<<<<<<<<<<<<
 *             fmuType = FMIL.fmi2_cosimulation
 *         else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), ((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2)); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3551
 *             fmuType = FMIL.fmi2_model_exchange
 *         elif isinstance(self,FMUModelCS2):
 *             fmuType = FMIL.fmi2_cosimulation             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('The instance is not curent an instance of an ME-model or a CS-model. Use load_fmu for correct loading.')
 */
    __pyx_v_fmuType = fmi2_cosimulation;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3553
 *             fmuType = FMIL.fmi2_cosimulation
 *         else:
 *             raise FMUException('The instance is not curent an instance of an ME-model or a CS-model. Use load_fmu for correct loading.')             # <<<<<<<<<<<<<<
 * 
 *         name = encode(name)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __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 = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":3555
 *             raise FMUException('The instance is not curent an instance of an ME-model or a CS-model. Use load_fmu for correct loading.')
 * 
 *         name = encode(name)             # <<<<<<<<<<<<<<
 *         status =  FMIL.fmi2_import_instantiate(self._fmu, name, fmuType, NULL, vis)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":3556
 * 
 *         name = encode(name)
 *         status =  FMIL.fmi2_import_instantiate(self._fmu, name, fmuType, NULL, vis)             # <<<<<<<<<<<<<<
 * 
 *         if status != FMIL.jm_status_success:
 */
  __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((__pyx_t_7 == (fmi2_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_status = fmi2_import_instantiate(__pyx_v_self->_fmu, __pyx_t_7, __pyx_v_fmuType, NULL, __pyx_v_vis);

  /* "pyfmi\fmi.pyx":3558
 *         status =  FMIL.fmi2_import_instantiate(self._fmu, name, fmuType, NULL, vis)
 * 
 *         if status != FMIL.jm_status_success:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')
 * 
 */
  __pyx_t_1 = ((__pyx_v_status != jm_status_success) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3559
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def setup_experiment(self, tolerance_defined=True, tolerance="Default", start_time="Default", stop_time_defined=False, stop_time="Default"):
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3559; __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 = 3559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* function exit code */
  __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_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.instantiate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3561
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')
 * 
 *     def setup_experiment(self, tolerance_defined=True, tolerance="Default", start_time="Default", stop_time_defined=False, stop_time="Default"):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the underlying FMU method for creating an experiment.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_29setup_experiment(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_28setup_experiment[] = "\n        Calls the underlying FMU method for creating an experiment.\n        \n        Parameters::\n        \n            tolerance_defined --\n            tolerance --\n            start_time --\n            stop_time_defined --\n            stop_time --\n            \n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_29setup_experiment(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_tolerance_defined = 0;
  PyObject *__pyx_v_tolerance = 0;
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_stop_time_defined = 0;
  PyObject *__pyx_v_stop_time = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setup_experiment (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tolerance_defined,&__pyx_n_s_tolerance,&__pyx_n_s_start_time,&__pyx_n_s_stop_time_defined,&__pyx_n_s_stop_time,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)Py_True);
    values[1] = ((PyObject *)__pyx_n_s_Default);
    values[2] = ((PyObject *)__pyx_n_s_Default);
    values[3] = ((PyObject *)Py_False);
    values[4] = ((PyObject *)__pyx_n_s_Default);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tolerance_defined);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tolerance);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_time);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop_time_defined);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop_time);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setup_experiment") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3561; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_tolerance_defined = values[0];
    __pyx_v_tolerance = values[1];
    __pyx_v_start_time = values[2];
    __pyx_v_stop_time_defined = values[3];
    __pyx_v_stop_time = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setup_experiment", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3561; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.setup_experiment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_28setup_experiment(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_tolerance_defined, __pyx_v_tolerance, __pyx_v_start_time, __pyx_v_stop_time_defined, __pyx_v_stop_time);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_28setup_experiment(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_tolerance_defined, PyObject *__pyx_v_tolerance, PyObject *__pyx_v_start_time, PyObject *__pyx_v_stop_time_defined, PyObject *__pyx_v_stop_time) {
  int __pyx_v_status;
  fmi2_boolean_t __pyx_v_stop_defined;
  fmi2_boolean_t __pyx_v_tol_defined;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_boolean_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  fmi2_boolean_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  fmi2_real_t __pyx_t_7;
  fmi2_real_t __pyx_t_8;
  fmi2_real_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setup_experiment", 0);
  __Pyx_INCREF(__pyx_v_tolerance);
  __Pyx_INCREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_stop_time);

  /* "pyfmi\fmi.pyx":3576
 *         cdef int status
 * 
 *         cdef FMIL.fmi2_boolean_t stop_defined = FMI2_TRUE if stop_time_defined else FMI2_FALSE             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi2_boolean_t tol_defined = FMI2_TRUE if tolerance_defined else FMI2_FALSE
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_stop_time_defined); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_TRUE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_As_fmi2_boolean_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_FALSE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_As_fmi2_boolean_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_v_stop_defined = __pyx_t_1;

  /* "pyfmi\fmi.pyx":3577
 * 
 *         cdef FMIL.fmi2_boolean_t stop_defined = FMI2_TRUE if stop_time_defined else FMI2_FALSE
 *         cdef FMIL.fmi2_boolean_t tol_defined = FMI2_TRUE if tolerance_defined else FMI2_FALSE             # <<<<<<<<<<<<<<
 * 
 *         if tolerance == "Default":
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_tolerance_defined); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_TRUE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_As_fmi2_boolean_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_FALSE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_As_fmi2_boolean_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_v_tol_defined = __pyx_t_1;

  /* "pyfmi\fmi.pyx":3579
 *         cdef FMIL.fmi2_boolean_t tol_defined = FMI2_TRUE if tolerance_defined else FMI2_FALSE
 * 
 *         if tolerance == "Default":             # <<<<<<<<<<<<<<
 *             tolerance = self.get_default_experiment_tolerance()
 *         if start_time == "Default":
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_tolerance, __pyx_n_s_Default, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3580
 * 
 *         if tolerance == "Default":
 *             tolerance = self.get_default_experiment_tolerance()             # <<<<<<<<<<<<<<
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_tolerance); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_tolerance, __pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3581
 *         if tolerance == "Default":
 *             tolerance = self.get_default_experiment_tolerance()
 *         if start_time == "Default":             # <<<<<<<<<<<<<<
 *             start_time = self.get_default_experiment_start_time()
 *         if stop_time == "Default":
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_start_time, __pyx_n_s_Default, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3582
 *             tolerance = self.get_default_experiment_tolerance()
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()             # <<<<<<<<<<<<<<
 *         if stop_time == "Default":
 *             stop_time = self.get_default_experiment_stop_time()
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_start_tim); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_start_time, __pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":3583
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()
 *         if stop_time == "Default":             # <<<<<<<<<<<<<<
 *             stop_time = self.get_default_experiment_stop_time()
 * 
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stop_time, __pyx_n_s_Default, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3584
 *             start_time = self.get_default_experiment_start_time()
 *         if stop_time == "Default":
 *             stop_time = self.get_default_experiment_stop_time()             # <<<<<<<<<<<<<<
 * 
 *         self.__t = start_time
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_stop_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_stop_time, __pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":3586
 *             stop_time = self.get_default_experiment_stop_time()
 * 
 *         self.__t = start_time             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_setup_experiment(self._fmu,
 */
  __Pyx_INCREF(__pyx_v_start_time);
  __Pyx_GIVEREF(__pyx_v_start_time);
  __Pyx_GOTREF(__pyx_v_self->__pyx___t);
  __Pyx_DECREF(__pyx_v_self->__pyx___t);
  __pyx_v_self->__pyx___t = __pyx_v_start_time;

  /* "pyfmi\fmi.pyx":3589
 * 
 *         status = FMIL.fmi2_import_setup_experiment(self._fmu,
 *                 tol_defined, tolerance, start_time, stop_defined, stop_time)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_tolerance); if (unlikely((__pyx_t_7 == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_start_time); if (unlikely((__pyx_t_8 == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_stop_time); if (unlikely((__pyx_t_9 == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":3588
 *         self.__t = start_time
 * 
 *         status = FMIL.fmi2_import_setup_experiment(self._fmu,             # <<<<<<<<<<<<<<
 *                 tol_defined, tolerance, start_time, stop_defined, stop_time)
 * 
 */
  __pyx_v_status = fmi2_import_setup_experiment(__pyx_v_self->_fmu, __pyx_v_tol_defined, __pyx_t_7, __pyx_t_8, __pyx_v_stop_defined, __pyx_t_9);

  /* "pyfmi\fmi.pyx":3591
 *                 tol_defined, tolerance, start_time, stop_defined, stop_time)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to setup the experiment.')
 * 
 */
  __pyx_t_2 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3592
 * 
 *         if status != 0:
 *             raise FMUException('Failed to setup the experiment.')             # <<<<<<<<<<<<<<
 * 
 *     def reset(self):
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __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 = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3561
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')
 * 
 *     def setup_experiment(self, tolerance_defined=True, tolerance="Default", start_time="Default", stop_time_defined=False, stop_time="Default"):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the underlying FMU method for creating an experiment.
 */

  /* function exit code */
  __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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.setup_experiment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tolerance);
  __Pyx_XDECREF(__pyx_v_start_time);
  __Pyx_XDECREF(__pyx_v_stop_time);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3594
 *             raise FMUException('Failed to setup the experiment.')
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         Resets the FMU back to its original state. Note that the environment
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_31reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_30reset[] = "\n        Resets the FMU back to its original state. Note that the environment \n        has to initialize the FMU again after this function-call.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_31reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_30reset(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_30reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);

  /* "pyfmi\fmi.pyx":3601
 *         cdef int status
 * 
 *         status = FMIL.fmi2_import_reset(self._fmu)             # <<<<<<<<<<<<<<
 *         if status != 0:
 *             raise FMUException('An error occured when reseting the model, see the log for possible more information')
 */
  __pyx_v_status = fmi2_import_reset(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3602
 * 
 *         status = FMIL.fmi2_import_reset(self._fmu)
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured when reseting the model, see the log for possible more information')
 * 
 */
  __pyx_t_1 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3603
 *         status = FMIL.fmi2_import_reset(self._fmu)
 *         if status != 0:
 *             raise FMUException('An error occured when reseting the model, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__109, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __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 = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3606
 * 
 *         #Default values
 *         self.__t = None             # <<<<<<<<<<<<<<
 * 
 *         #Reseting the allocation flags
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->__pyx___t);
  __Pyx_DECREF(__pyx_v_self->__pyx___t);
  __pyx_v_self->__pyx___t = Py_None;

  /* "pyfmi\fmi.pyx":3609
 * 
 *         #Reseting the allocation flags
 *         self._allocated_fmu = 0             # <<<<<<<<<<<<<<
 * 
 *         #Internal values
 */
  __pyx_v_self->_allocated_fmu = 0;

  /* "pyfmi\fmi.pyx":3612
 * 
 *         #Internal values
 *         self._log = []             # <<<<<<<<<<<<<<
 * 
 *     def terminate(self):
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->_log);
  __Pyx_DECREF(__pyx_v_self->_log);
  __pyx_v_self->_log = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":3594
 *             raise FMUException('Failed to setup the experiment.')
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         Resets the FMU back to its original state. Note that the environment
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_33terminate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_32terminate[] = "\n        Calls the FMI function fmi2Terminate() on the FMU.\n        After this call, any call to a function changing the state of the FMU will fail.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_33terminate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("terminate (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_32terminate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3621
 *         FMIL.fmi2_import_terminate(self._fmu)
 * 
 *     def initialize(self):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the model and computes initial values for all variables.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_35initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_34initialize[] = "\n        Initializes the model and computes initial values for all variables.\n\n        Calls the low-level FMI functions: fmi2EnterInitializationMode,\n                                           fmi2ExitInitializationMode\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_35initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_34initialize(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_34initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialize", 0);

  /* "pyfmi\fmi.pyx":3628
 *                                            fmi2ExitInitializationMode
 *         """
 *         if self.time == None:             # <<<<<<<<<<<<<<
 *             raise FMUException("Setup Experiment has to be called prior to the initialization method.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3629
 *         """
 *         if self.time == None:
 *             raise FMUException("Setup Experiment has to be called prior to the initialization method.")             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_enter_initialization_mode(self._fmu)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __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 = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3631
 *             raise FMUException("Setup Experiment has to be called prior to the initialization method.")
 * 
 *         status = FMIL.fmi2_import_enter_initialization_mode(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if status == 1:
 */
  __pyx_v_status = fmi2_import_enter_initialization_mode(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3633
 *         status = FMIL.fmi2_import_enter_initialization_mode(self._fmu)
 * 
 *         if status == 1:             # <<<<<<<<<<<<<<
 *             if self._enable_logging:
 *                 logging.warning(
 */
  __pyx_t_3 = ((__pyx_v_status == 1) != 0);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3634
 * 
 *         if status == 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 logging.warning(
 *                     'Enter Initialize returned with a warning.' \
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_enable_logging); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":3635
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Enter Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __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_PyObject_Call(__pyx_t_2, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3639
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 logging.warning('Enter Initialize returned with a warning.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __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_PyObject_Call(__pyx_t_2, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":3642
 *                     ' 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) != 0);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3643
 * 
 *         if status > 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException(
 *                     'Enter Initialize returned with an error.' \
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_enable_logging); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":3644
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Enter Initialize returned with an error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __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 = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3648
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Enter Initialize returned with an error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3648; __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 = 3648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

  /* "pyfmi\fmi.pyx":3651
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 *         status = FMIL.fmi2_import_exit_initialization_mode(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if status == 1:
 */
  __pyx_v_status = fmi2_import_exit_initialization_mode(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3653
 *         status = FMIL.fmi2_import_exit_initialization_mode(self._fmu)
 * 
 *         if status == 1:             # <<<<<<<<<<<<<<
 *             if self._enable_logging:
 *                 logging.warning(
 */
  __pyx_t_3 = ((__pyx_v_status == 1) != 0);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3654
 * 
 *         if status == 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 logging.warning(
 *                     'Exit Initialize returned with a warning.' \
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_enable_logging); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":3655
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Exit Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __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_PyObject_Call(__pyx_t_2, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3659
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 logging.warning('Exit Initialize returned with a warning.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __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_PyObject_Call(__pyx_t_2, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L9:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":3662
 *                     ' 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) != 0);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3663
 * 
 *         if status > 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException(
 *                     'Exit Initialize returned with an error.' \
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_enable_logging); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":3664
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Exit Initialize returned with an error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __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 = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3668
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Exit Initialize returned with an error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3668; __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 = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

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

  /* "pyfmi\fmi.pyx":3621
 *         FMIL.fmi2_import_terminate(self._fmu)
 * 
 *     def initialize(self):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the model and computes initial values for all variables.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_37set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_v_level); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_36set_fmil_log_level[] = "\n        Specifies the log level for FMI Library. Note that this is\n        different from the FMU logging which is specified via\n        set_debug_logging.\n\n        Parameters::\n\n            level --\n                The log level. Available values:\n                    NOTHING = 0\n                    FATAL = 1\n                    ERROR = 2\n                    WARNING = 3\n                    INFO = 4\n                    VERBOSE = 5\n                    DEBUG = 6\n                    ALL = 7\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_37set_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_36set_fmil_log_level(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_level));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":3694
 *                     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_2 = PyObject_RichCompare(__pyx_v_level, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_level, __pyx_int_7, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3695
 *         """
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __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 = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3696
 *         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_5 = ((jm_log_level_enu_t)PyInt_AsLong(__pyx_v_level)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->callbacks.log_level = ((jm_log_level_enu_t)__pyx_t_5);

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

  /* function exit code */
  __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_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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_39get_fmil_log_level(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_38get_fmil_log_level[] = "\n        Returns::\n\n            The current fmil log-level.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_39get_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_38get_fmil_log_level(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

    /* "pyfmi\fmi.pyx":3709
 *         if self._enable_logging:
 *             level = self.callbacks.log_level
 *             return level             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Logging is not enabled')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_level); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3711
 *             return level
 *         else:
 *             raise FMUException('Logging is not enabled')             # <<<<<<<<<<<<<<
 * 
 *     def set_debug_logging(self, logging_on, categories = []):
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3711; __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 = 3711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_fmil_log_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3713
 *             raise FMUException('Logging is not enabled')
 * 
 *     def set_debug_logging(self, logging_on, categories = []):             # <<<<<<<<<<<<<<
 *         """
 *         Specifies if the debugging should be turned on or off.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_41set_debug_logging(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_40set_debug_logging[] = "\n        Specifies if the debugging should be turned on or off.\n        Currently the only allowed value for categories is an empty list.\n\n        Parameters::\n\n            logging_on --\n                Boolean value.\n\n            categories --\n                List of categories to log, call get_categories() for list of categories.\n                Default: [] (all categories)\n\n        Calls the low-level FMI function: fmi2SetDebuggLogging\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_41set_debug_logging(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_logging_on = 0;
  PyObject *__pyx_v_categories = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_debug_logging (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_logging_on,&__pyx_n_s_categories,0};
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k__121;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_logging_on)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_categories);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_debug_logging") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3713; __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 = 3713; __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_40set_debug_logging(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_logging_on, __pyx_v_categories);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_40set_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":3732
 *         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":3734
 *         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 = 3734; __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":3736
 *         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 = 3736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

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

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

  /* "pyfmi\fmi.pyx":3741
 *             log = 0
 * 
 *         self._enable_logging = bool(log)             # <<<<<<<<<<<<<<
 * 
 *         if len(categories) > 0:
 */
  __pyx_t_3 = __Pyx_PyInt_From_fmi2_boolean_t(__pyx_v_log); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __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 = 3741; __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 = 3741; __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":3743
 *         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 = 3743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((__pyx_t_4 > 0) != 0);
  if (__pyx_t_2) {

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

  /* "pyfmi\fmi.pyx":3746
 *             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":3748
 *         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) != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3749
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def get_categories(self):
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3749; __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 = 3749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3713
 *             raise FMUException('Logging is not enabled')
 * 
 *     def set_debug_logging(self, logging_on, categories = []):             # <<<<<<<<<<<<<<
 *         """
 *         Specifies if the debugging should be turned on or off.
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":3751
 *             raise FMUException('Failed to set the debugging option.')
 * 
 *     def get_categories(self):             # <<<<<<<<<<<<<<
 *         """
 *         Method used to retrieve the logging categories.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_43get_categories(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_42get_categories[] = "\n        Method used to retrieve the logging categories.\n\n        Returns::\n            A list with two objects. The first is the number of log categories\n            and the second is a list with the categories available for logging.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_43get_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_42get_categories(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_42get_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":3761
 *         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 = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_self->_categories, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3762
 * 
 *         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":3763
 *         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(__pyx_v_self->_categories == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_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 = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->_categories, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }

    /* "pyfmi\fmi.pyx":3764
 *             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_From_size_t(__pyx_v_self->_nCategories); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3764; __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 = 3764; __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(__pyx_v_self->_categories);
    PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_categories);
    __Pyx_GIVEREF(__pyx_v_self->_categories);
    __pyx_t_2 = 0;
    __pyx_v_output = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3766
 *             output = [self._nCategories, self._categories]
 *         else:
 *             output = [self._nCategories, self._categories]             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
    __pyx_t_1 = __Pyx_PyInt_From_size_t(__pyx_v_self->_nCategories); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __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 = 3766; __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(__pyx_v_self->_categories);
    PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->_categories);
    __Pyx_GIVEREF(__pyx_v_self->_categories);
    __pyx_t_1 = 0;
    __pyx_v_output = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3768
 *             output = [self._nCategories, self._categories]
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_output);
  __pyx_r = __pyx_v_output;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":3751
 *             raise FMUException('Failed to set the debugging option.')
 * 
 *     def get_categories(self):             # <<<<<<<<<<<<<<
 *         """
 *         Method used to retrieve the logging categories.
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":3771
 * 
 * 
 *     def get_variable_nominal(self, variable_name=None, valueref=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the nominal value from a real variable determined by
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_45get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_44get_variable_nominal[] = "\n        Returns the nominal value from a real variable determined by\n        either its value reference or its variable name.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n            valueref --\n                The value reference of the variable.\n\n        Returns::\n\n            The nominal value of the given variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_45get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variable_name = 0;
  PyObject *__pyx_v_valueref = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_nominal (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_variable_name,&__pyx_n_s_valueref,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_variable_name);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_valueref);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_variable_nominal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3771; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_variable_name = values[0];
    __pyx_v_valueref = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_variable_nominal", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3771; __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_44get_variable_nominal(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_variable_name, __pyx_v_valueref);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_44get_variable_nominal(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_valueref) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_real_variable_t *__pyx_v_real_variable;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  fmi2_value_reference_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  char *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_nominal", 0);
  __Pyx_INCREF(__pyx_v_variable_name);

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

    /* "pyfmi\fmi.pyx":3793
 * 
 *         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_As_size_t(__pyx_v_valueref); if (unlikely((__pyx_t_3 == (fmi2_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3793; __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":3794
 *         if valueref != None:
 *             variable = FMIL.fmi2_import_get_variable_by_vr(self._fmu, FMIL.fmi2_base_type_real, <FMIL.fmi2_value_reference_t>valueref)
 *             if variable == NULL:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 *         elif variable_name != None:
 */
    __pyx_t_2 = ((__pyx_v_variable == NULL) != 0);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3795
 *             variable = FMIL.fmi2_import_get_variable_by_vr(self._fmu, FMIL.fmi2_base_type_real, <FMIL.fmi2_value_reference_t>valueref)
 *             if variable == NULL:
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))             # <<<<<<<<<<<<<<
 *         elif variable_name != None:
 *             variable_name = encode(variable_name)
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __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 = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_valueref);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_valueref);
      __Pyx_GIVEREF(__pyx_v_valueref);
      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_with_value_referenc, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L3;
  }

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

    /* "pyfmi\fmi.pyx":3797
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 *         elif variable_name != None:
 *             variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *             variablename = variable_name
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
    __pyx_t_1 = 0;

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

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

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

      /* "pyfmi\fmi.pyx":3802
 *             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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __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 = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L3;
  }
  /*else*/ {

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

  /* "pyfmi\fmi.pyx":3806
 *             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":3807
 * 
 *         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) != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3808
 *         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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_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 = 3808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":3771
 * 
 * 
 *     def get_variable_nominal(self, variable_name=None, valueref=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the nominal value from a real variable determined by
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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.get_variable_nominal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_47get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_46get_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_47get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_type = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_by_valueref (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_valueref,&__pyx_n_s_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_variable_by_valueref") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3812; __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 = 3812; __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_46get_variable_by_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_valueref, __pyx_v_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_46get_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;
  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("get_variable_by_valueref", 0);

  /* "pyfmi\fmi.pyx":3835
 *         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 = 3835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_valueref); if (unlikely((__pyx_t_2 == (fmi2_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3835; __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":3836
 * 
 *         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) != 0);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3837
 *         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_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_with_the_valuref_i, __pyx_v_valueref); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __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 = 3837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3839
 *             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":3841
 *         name = FMIL.fmi2_import_get_variable_name(variable)
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_alias_base(self, char* variablename):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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_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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_49get_variable_alias_base(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_48get_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_49get_variable_alias_base(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_alias_base (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = __Pyx_PyObject_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3843; __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_48get_variable_alias_base(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":3859
 *         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":3860
 * 
 *         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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3861
 *         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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __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 = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3863
 *             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":3864
 * 
 *         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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3865
 *         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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3865; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3865; __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_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3867
 *             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":3869
 *         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 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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;
}

/* "pyfmi\fmi.pyx":3871
 *         return name
 * 
 *     def get_variable_alias(self, char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Return a dict of all alias variables belonging to the provided variable
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_51get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_50get_variable_alias[] = "\n        Return a dict of all alias variables belonging to the provided variable\n        where the key are the names and the value indicating whether the variable\n        should be negated or not.\n\n        Parameters::\n\n            variablename--\n                Name of the variable to find alias of.\n\n\n        Returns::\n\n            A dict consisting of the alias variables along with no alias variable.\n            The values indicates whether or not the variable should be negated or not.\n\n        Raises::\n\n            FMUException if the variable is not in the model.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_51get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_alias (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = __Pyx_PyObject_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3871; __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_50get_variable_alias(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_50get_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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_alias", 0);

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

  /* "pyfmi\fmi.pyx":3900
 *         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":3901
 * 
 *         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) != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3902
 *         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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __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 = 3902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":3904
 *             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":3906
 *         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":3909
 * 
 *         #Loop over all the alias variables
 *         for i in range(alias_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi2_import_get_variable(alias_list, i)
 */
  __pyx_t_7 = __pyx_v_alias_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":3911
 *         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":3913
 *             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":3914
 * 
 *             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":3916
 *             alias_name = FMIL.fmi2_import_get_variable_name(variable)
 * 
 *             ret_values[alias_name] = alias_kind             # <<<<<<<<<<<<<<
 * 
 *         #FREE VARIABLE LIST
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_alias_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(PyDict_SetItem(__pyx_v_ret_values, __pyx_t_3, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3916; __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":3919
 * 
 *         #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":3921
 *         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(__pyx_v_ret_values);
  __pyx_r = __pyx_v_ret_values;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":3871
 *         return name
 * 
 *     def get_variable_alias(self, char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Return a dict of all alias variables belonging to the provided variable
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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;
}

/* "pyfmi\fmi.pyx":3923
 *         return ret_values
 * 
 *     def get_model_time_varying_value_references(self, filter=None):             # <<<<<<<<<<<<<<
 *         """
 *         Extract the value references of the variables in a model
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_53get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_52get_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_53get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filter = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_time_varying_value_references (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filter,0};
    PyObject* values[1] = {0};
    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 = 3923; __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 = 3923; __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_52get_model_time_varying_value_references(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_filter);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_52get_model_time_varying_value_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_filter) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_variable_list_t *__pyx_v_variable_list;
  size_t __pyx_v_variable_list_size;
  fmi2_value_reference_t __pyx_v_value_ref;
  fmi2_base_type_enu_t __pyx_v_data_type;
  fmi2_variability_enu_t __pyx_v_data_variability;
  fmi2_variable_alias_kind_enu_t __pyx_v_alias_kind;
  int __pyx_v_i;
  int __pyx_v_selected_filter;
  int __pyx_v_length_filter;
  PyObject *__pyx_v_real_var_ref = 0;
  PyObject *__pyx_v_int_var_ref = 0;
  PyObject *__pyx_v_bool_var_ref = 0;
  PyObject *__pyx_v_filter_list = NULL;
  PyObject *__pyx_v_name = NULL;
  int __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  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":3949
 *         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 = 3949; __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":3950
 *         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":3951
 *         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 = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_real_var_ref = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

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

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

  /* "pyfmi\fmi.pyx":3955
 *         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":3956
 * 
 *         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":3958
 *         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)
 */
  __pyx_t_2 = (__pyx_v_selected_filter != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3959
 * 
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)             # <<<<<<<<<<<<<<
 *             length_filter = len(filter_list)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert_filter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_filter); 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);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_filter);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_filter);
      __Pyx_GIVEREF(__pyx_v_filter);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); 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);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_filter_list = __pyx_t_3;
    __pyx_t_3 = 0;

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

  /* "pyfmi\fmi.pyx":3962
 *             length_filter = len(filter_list)
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 */
  __pyx_t_8 = __pyx_v_variable_list_size;
  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_8; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "pyfmi\fmi.pyx":3964
 *         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":3966
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 * 
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 */
    __pyx_v_alias_kind = fmi2_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":3967
 * 
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyBytes_FromString(fmi2_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":3968
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 */
    __pyx_v_value_ref = fmi2_import_get_variable_vr(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":3969
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 * 
 */
    __pyx_v_data_type = fmi2_import_get_variable_base_type(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":3970
 *             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":3973
 * 
 * 
 *             if data_type != FMI2_REAL and data_type != FMI2_INTEGER and data_type != FMI2_BOOLEAN and data_type != FMI2_ENUMERATION:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_REAL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_10) {
    } else {
      __pyx_t_2 = __pyx_t_10;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_9 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_INTEGER); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_10) {
    } else {
      __pyx_t_2 = __pyx_t_10;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_3 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_BOOLEAN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_10) {
    } else {
      __pyx_t_2 = __pyx_t_10;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_9 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_ENUMERATION); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __pyx_t_10;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3974
 * 
 *             if data_type != FMI2_REAL and data_type != FMI2_INTEGER and data_type != FMI2_BOOLEAN and data_type != FMI2_ENUMERATION:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if data_variability != FMI2_CONTINUOUS and data_variability != FMI2_DISCRETE and data_variability != FMI2_TUNABLE:
 */
      goto __pyx_L4_continue;
    }

    /* "pyfmi\fmi.pyx":3976
 *                 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 = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_CONTINUOUS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_10) {
    } else {
      __pyx_t_2 = __pyx_t_10;
      goto __pyx_L12_bool_binop_done;
    }
    __pyx_t_9 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_DISCRETE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_10) {
    } else {
      __pyx_t_2 = __pyx_t_10;
      goto __pyx_L12_bool_binop_done;
    }
    __pyx_t_3 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_TUNABLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_2 = __pyx_t_10;
    __pyx_L12_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3977
 * 
 *             if data_variability != FMI2_CONTINUOUS and data_variability != FMI2_DISCRETE and data_variability != FMI2_TUNABLE:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if selected_filter:
 */
      goto __pyx_L4_continue;
    }

    /* "pyfmi\fmi.pyx":3979
 *                 continue
 * 
 *             if selected_filter:             # <<<<<<<<<<<<<<
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):
 */
    __pyx_t_2 = (__pyx_v_selected_filter != 0);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3980
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     if re.match(filter_list[j], name):
 *                         break
 */
      __pyx_t_11 = __pyx_v_length_filter;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_j = __pyx_t_12;

        /* "pyfmi\fmi.pyx":3981
 *             if selected_filter:
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_v_filter_list)) { __Pyx_RaiseUnboundLocalError("filter_list"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_filter_list, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3981; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_7 = 1;
          }
        }
        __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_6) {
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
        }
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        __pyx_t_4 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_2) {

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

        /* "pyfmi\fmi.pyx":3984
 *                         break
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 *             else:
 *                 if alias_kind != FMIL.fmi2_variable_is_not_alias:
 */
        goto __pyx_L4_continue;
      }
      __pyx_L17_break:;
      goto __pyx_L15;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3986
 *                     continue
 *             else:
 *                 if alias_kind != FMIL.fmi2_variable_is_not_alias:             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
      __pyx_t_2 = ((__pyx_v_alias_kind != fmi2_variable_is_not_alias) != 0);
      if (__pyx_t_2) {

        /* "pyfmi\fmi.pyx":3987
 *             else:
 *                 if alias_kind != FMIL.fmi2_variable_is_not_alias:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if data_type == FMI2_REAL:
 */
        goto __pyx_L4_continue;
      }
    }
    __pyx_L15:;

    /* "pyfmi\fmi.pyx":3989
 *                     continue
 * 
 *             if data_type == FMI2_REAL:             # <<<<<<<<<<<<<<
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI2_INTEGER or data_type == FMI2_ENUMERATION:
 */
    __pyx_t_9 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_REAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_9, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3990
 * 
 *             if data_type == FMI2_REAL:
 *                 real_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 *             if data_type == FMI2_INTEGER or data_type == FMI2_ENUMERATION:
 *                 int_var_ref[value_ref] = 1
 */
      __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_v_real_var_ref, __pyx_t_5, __pyx_int_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L20;
    }
    __pyx_L20:;

    /* "pyfmi\fmi.pyx":3991
 *             if data_type == FMI2_REAL:
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI2_INTEGER or data_type == FMI2_ENUMERATION:             # <<<<<<<<<<<<<<
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI2_BOOLEAN:
 */
    __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_INTEGER); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (!__pyx_t_10) {
    } else {
      __pyx_t_2 = __pyx_t_10;
      goto __pyx_L22_bool_binop_done;
    }
    __pyx_t_9 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_ENUMERATION); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_9, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __pyx_t_10;
    __pyx_L22_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3992
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI2_INTEGER or data_type == FMI2_ENUMERATION:
 *                 int_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 *             if data_type == FMI2_BOOLEAN:
 *                 bool_var_ref[value_ref] = 1
 */
      __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_v_int_var_ref, __pyx_t_5, __pyx_int_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L21;
    }
    __pyx_L21:;

    /* "pyfmi\fmi.pyx":3993
 *             if data_type == FMI2_INTEGER or data_type == FMI2_ENUMERATION:
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI2_BOOLEAN:             # <<<<<<<<<<<<<<
 *                 bool_var_ref[value_ref] = 1
 * 
 */
    __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_BOOLEAN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3994
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI2_BOOLEAN:
 *                 bool_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 * 
 *         #Free the variable list
 */
      __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (unlikely(PyDict_SetItem(__pyx_v_bool_var_ref, __pyx_t_9, __pyx_int_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L24;
    }
    __pyx_L24:;
    __pyx_L4_continue:;
  }

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

  /* "pyfmi\fmi.pyx":3999
 *         FMIL.fmi2_import_free_variable_list(variable_list)
 * 
 *         return list(real_var_ref.keys()) if python3_flag else real_var_ref.keys(), list(int_var_ref.keys()) if python3_flag else int_var_ref.keys(), list(bool_var_ref.keys()) if python3_flag else bool_var_ref.keys()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3_flag); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __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 = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyDict_Keys(__pyx_v_real_var_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyDict_Keys(__pyx_v_real_var_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3_flag); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {
    __pyx_t_5 = __Pyx_PyDict_Keys(__pyx_v_int_var_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __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 = 3999; __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __pyx_t_5 = __Pyx_PyDict_Keys(__pyx_v_int_var_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3_flag); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __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 = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {
    __pyx_t_4 = __Pyx_PyDict_Keys(__pyx_v_bool_var_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __pyx_t_4 = __Pyx_PyDict_Keys(__pyx_v_bool_var_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_9 = 0;
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":3923
 *         return ret_values
 * 
 *     def get_model_time_varying_value_references(self, filter=None):             # <<<<<<<<<<<<<<
 *         """
 *         Extract the value references of the variables in a model
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_model_time_varying_value_references", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_real_var_ref);
  __Pyx_XDECREF(__pyx_v_int_var_ref);
  __Pyx_XDECREF(__pyx_v_bool_var_ref);
  __Pyx_XDECREF(__pyx_v_filter_list);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4002
 * 
 * 
 *     def get_model_variables(self, type = None, include_alias = True,             # <<<<<<<<<<<<<<
 *                              causality = None,   variability = None,
 *                             only_start = False,   only_fixed = False,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_55get_model_variables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_54get_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_55get_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_variables (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_include_alias,&__pyx_n_s_causality,&__pyx_n_s_variability,&__pyx_n_s_only_start,&__pyx_n_s_only_fixed,&__pyx_n_s_filter,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_True);

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

    /* "pyfmi\fmi.pyx":4004
 *     def get_model_variables(self, type = None, include_alias = True,
 *                              causality = None,   variability = None,
 *                             only_start = False,   only_fixed = False,             # <<<<<<<<<<<<<<
 *                             filter = None):
 *         """
 */
    values[4] = ((PyObject *)Py_False);
    values[5] = ((PyObject *)Py_False);

    /* "pyfmi\fmi.pyx":4005
 *                              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 = 4002; __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 = 4002; __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_54get_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);

  /* "pyfmi\fmi.pyx":4002
 * 
 * 
 *     def get_model_variables(self, type = None, include_alias = True,             # <<<<<<<<<<<<<<
 *                              causality = None,   variability = None,
 *                             only_start = False,   only_fixed = False,
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_54get_model_variables(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_include_alias, PyObject *__pyx_v_causality, PyObject *__pyx_v_variability, PyObject *__pyx_v_only_start, PyObject *__pyx_v_only_fixed, PyObject *__pyx_v_filter) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_variable_list_t *__pyx_v_variable_list;
  size_t __pyx_v_variable_list_size;
  fmi2_value_reference_t __pyx_v_value_ref;
  fmi2_base_type_enu_t __pyx_v_data_type;
  fmi2_base_type_enu_t __pyx_v_target_type;
  fmi2_variability_enu_t __pyx_v_data_variability;
  fmi2_variability_enu_t __pyx_v_target_variability;
  fmi2_causality_enu_t __pyx_v_data_causality;
  fmi2_causality_enu_t __pyx_v_target_causality;
  fmi2_variable_alias_kind_enu_t __pyx_v_alias_kind;
  fmi2_initial_enu_t __pyx_v_initial;
  char *__pyx_v_desc;
  int __pyx_v_selected_type;
  int __pyx_v_selected_variability;
  int __pyx_v_selected_causality;
  int __pyx_v_has_start;
  int __pyx_v_i;
  int __pyx_v_selected_filter;
  int __pyx_v_length_filter;
  PyObject *__pyx_v_variable_dict = NULL;
  PyObject *__pyx_v_filter_list = NULL;
  PyObject *__pyx_v_name = NULL;
  int __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  fmi2_base_type_enu_t __pyx_t_6;
  fmi2_causality_enu_t __pyx_t_7;
  fmi2_variability_enu_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  size_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_model_variables", 0);

  /* "pyfmi\fmi.pyx":4061
 *         cdef FMIL.fmi2_initial_enu_t             initial
 *         cdef char* desc
 *         cdef int   selected_type = 0        #If a type has been selected             # <<<<<<<<<<<<<<
 *         cdef int   selected_variability = 0 #If a variability has been selected
 *         cdef int   selected_causality = 0   #If a causality has been selected
 */
  __pyx_v_selected_type = 0;

  /* "pyfmi\fmi.pyx":4062
 *         cdef char* desc
 *         cdef int   selected_type = 0        #If a type has been selected
 *         cdef int   selected_variability = 0 #If a variability has been selected             # <<<<<<<<<<<<<<
 *         cdef int   selected_causality = 0   #If a causality has been selected
 *         cdef int   has_start, is_fixed
 */
  __pyx_v_selected_variability = 0;

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

  /* "pyfmi\fmi.pyx":4068
 *         cdef int  selected_filter = 1 if filter else 0
 *         cdef int  length_filter = 0
 *         variable_dict = OrderedDict()             # <<<<<<<<<<<<<<
 * 
 *         variable_list      = FMIL.fmi2_import_get_variable_list(self._fmu, 0)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_variable_dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4070
 *         variable_dict = OrderedDict()
 * 
 *         variable_list      = FMIL.fmi2_import_get_variable_list(self._fmu, 0)             # <<<<<<<<<<<<<<
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 * 
 */
  __pyx_v_variable_list = fmi2_import_get_variable_list(__pyx_v_self->_fmu, 0);

  /* "pyfmi\fmi.pyx":4071
 * 
 *         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":4073
 *         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_3 = PyObject_RichCompare(__pyx_v_type, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

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

    /* "pyfmi\fmi.pyx":4075
 *         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":4076
 *             target_type = type
 *             selected_type = 1
 *         if causality != None:   #A causality has been selected             # <<<<<<<<<<<<<<
 *             target_causality = causality
 *             selected_causality = 1
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_causality, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

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

    /* "pyfmi\fmi.pyx":4078
 *         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":4079
 *             target_causality = causality
 *             selected_causality = 1
 *         if variability != None: #A variability has been selected             # <<<<<<<<<<<<<<
 *             target_variability = variability
 *             selected_variability = 1
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_variability, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

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

    /* "pyfmi\fmi.pyx":4081
 *         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":4082
 *             target_variability = variability
 *             selected_variability = 1
 *         if selected_filter:             # <<<<<<<<<<<<<<
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)
 */
  __pyx_t_2 = (__pyx_v_selected_filter != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4083
 *             selected_variability = 1
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)             # <<<<<<<<<<<<<<
 *             length_filter = len(filter_list)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert_filter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_filter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_filter);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_filter);
      __Pyx_GIVEREF(__pyx_v_filter);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_filter_list = __pyx_t_3;
    __pyx_t_3 = 0;

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

  /* "pyfmi\fmi.pyx":4086
 *             length_filter = len(filter_list)
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 */
  __pyx_t_11 = __pyx_v_variable_list_size;
  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_11; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "pyfmi\fmi.pyx":4088
 *         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":4090
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 * 
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 */
    __pyx_v_alias_kind = fmi2_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4091
 * 
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyBytes_FromString(fmi2_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4092
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 *             has_start        = FMIL.fmi2_import_get_variable_has_start(variable)  #fmi2_import_get_initial, may be of interest
 */
    __pyx_v_value_ref = fmi2_import_get_variable_vr(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4093
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 *             has_start        = FMIL.fmi2_import_get_variable_has_start(variable)  #fmi2_import_get_initial, may be of interest
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 */
    __pyx_v_data_type = fmi2_import_get_variable_base_type(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4094
 *             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":4095
 *             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":4096
 *             has_start        = FMIL.fmi2_import_get_variable_has_start(variable)  #fmi2_import_get_initial, may be of interest
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 *             data_causality   = FMIL.fmi2_import_get_causality(variable)             # <<<<<<<<<<<<<<
 *             desc             = FMIL.fmi2_import_get_variable_description(variable)
 *             initial          = FMIL.fmi2_import_get_initial(variable)
 */
    __pyx_v_data_causality = fmi2_import_get_causality(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4097
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 *             data_causality   = FMIL.fmi2_import_get_causality(variable)
 *             desc             = FMIL.fmi2_import_get_variable_description(variable)             # <<<<<<<<<<<<<<
 *             initial          = FMIL.fmi2_import_get_initial(variable)
 * 
 */
    __pyx_v_desc = fmi2_import_get_variable_description(__pyx_v_variable);

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

    /* "pyfmi\fmi.pyx":4101
 * 
 *             #If only variables with start are wanted, check if the variable has start
 *             if only_start and has_start != 1:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_only_start); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {
    } else {
      __pyx_t_2 = __pyx_t_13;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_13 = ((__pyx_v_has_start != 1) != 0);
    __pyx_t_2 = __pyx_t_13;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4102
 *             #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;
    }

    /* "pyfmi\fmi.pyx":4104
 *                 continue
 * 
 *             if only_fixed:             # <<<<<<<<<<<<<<
 *                 #fixed variability requires start-value
 *                 if has_start != 1:
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_only_fixed); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4106
 *             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_2 = ((__pyx_v_has_start != 1) != 0);
      if (__pyx_t_2) {

        /* "pyfmi\fmi.pyx":4107
 *                 #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;
      }

      /* "pyfmi\fmi.pyx":4108
 *                 if has_start != 1:
 *                     continue
 *                 elif (FMIL.fmi2_import_get_variability(variable) != FMIL.fmi2_variability_enu_fixed):             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
      __pyx_t_2 = ((fmi2_import_get_variability(__pyx_v_variable) != fmi2_variability_enu_fixed) != 0);
      if (__pyx_t_2) {

        /* "pyfmi\fmi.pyx":4109
 *                     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_L12;
    }
    __pyx_L12:;

    /* "pyfmi\fmi.pyx":4111
 *                     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) != 0);
    if (__pyx_t_13) {
    } else {
      __pyx_t_2 = __pyx_t_13;
      goto __pyx_L15_bool_binop_done;
    }
    __pyx_t_13 = ((__pyx_v_data_type != __pyx_v_target_type) != 0);
    __pyx_t_2 = __pyx_t_13;
    __pyx_L15_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4112
 * 
 *             if selected_type == 1 and data_type != target_type:
 *                 continue             # <<<<<<<<<<<<<<
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue
 */
      goto __pyx_L7_continue;
    }

    /* "pyfmi\fmi.pyx":4113
 *             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_13 = ((__pyx_v_selected_causality == 1) != 0);
    if (__pyx_t_13) {
    } else {
      __pyx_t_2 = __pyx_t_13;
      goto __pyx_L18_bool_binop_done;
    }
    __pyx_t_13 = ((__pyx_v_data_causality != __pyx_v_target_causality) != 0);
    __pyx_t_2 = __pyx_t_13;
    __pyx_L18_bool_binop_done:;
    if (__pyx_t_2) {

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

    /* "pyfmi\fmi.pyx":4115
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue
 *             if selected_variability == 1 and data_variability != target_variability:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_13 = ((__pyx_v_selected_variability == 1) != 0);
    if (__pyx_t_13) {
    } else {
      __pyx_t_2 = __pyx_t_13;
      goto __pyx_L21_bool_binop_done;
    }
    __pyx_t_13 = ((__pyx_v_data_variability != __pyx_v_target_variability) != 0);
    __pyx_t_2 = __pyx_t_13;
    __pyx_L21_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4116
 *                 continue
 *             if selected_variability == 1 and data_variability != target_variability:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if selected_filter:
 */
      goto __pyx_L7_continue;
    }

    /* "pyfmi\fmi.pyx":4118
 *                 continue
 * 
 *             if selected_filter:             # <<<<<<<<<<<<<<
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):
 */
    __pyx_t_2 = (__pyx_v_selected_filter != 0);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4119
 * 
 *             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":4120
 *             if selected_filter:
 *                 for j in range(length_filter):
 *                     if re.match(filter_list[j], name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_match); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_v_filter_list)) { __Pyx_RaiseUnboundLocalError("filter_list"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_filter_list, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4120; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = NULL;
        __pyx_t_10 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_10 = 1;
          }
        }
        __pyx_t_5 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_9) {
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
        }
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_10, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_10, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4120; __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_12); __pyx_t_12 = 0;
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_2) {

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

        /* "pyfmi\fmi.pyx":4123
 *                         break
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if include_alias:
 */
        goto __pyx_L7_continue;
      }
      __pyx_L25_break:;
      goto __pyx_L23;
    }
    __pyx_L23:;

    /* "pyfmi\fmi.pyx":4125
 *                     continue
 * 
 *             if include_alias:             # <<<<<<<<<<<<<<
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable2(name,
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_include_alias); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4128
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable2(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",             # <<<<<<<<<<<<<<
 *                                        data_variability, data_causality,
 *                                        alias_kind, initial)
 */
      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_12 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      if (((__pyx_v_desc != NULL) != 0)) {
        __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_desc, 0, strlen(__pyx_v_desc), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __pyx_t_4;
        __pyx_t_4 = 0;
      } else {
        __Pyx_INCREF(__pyx_kp_s__2);
        __pyx_t_5 = __pyx_kp_s__2;
      }

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

      /* "pyfmi\fmi.pyx":4130
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 *                                        alias_kind, initial)             # <<<<<<<<<<<<<<
 *             elif alias_kind == FMIL.fmi2_variable_is_not_alias:
 *                 #Exclude alias
 */
      __pyx_t_16 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = PyInt_FromLong(__pyx_v_initial); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);

      /* "pyfmi\fmi.pyx":4127
 *             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_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_INCREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_18, 4, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_18, 5, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_18, 6, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_18, 7, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      __pyx_t_3 = 0;
      __pyx_t_12 = 0;
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_9 = 0;
      __pyx_t_16 = 0;
      __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2)), __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_variable_dict, __pyx_v_name, __pyx_t_17) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      goto __pyx_L27;
    }

    /* "pyfmi\fmi.pyx":4131
 *                                        data_variability, data_causality,
 *                                        alias_kind, initial)
 *             elif alias_kind == FMIL.fmi2_variable_is_not_alias:             # <<<<<<<<<<<<<<
 *                 #Exclude alias
 *                 #variable_dict[name] = value_ref
 */
    __pyx_t_2 = ((__pyx_v_alias_kind == fmi2_variable_is_not_alias) != 0);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4135
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable2(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",             # <<<<<<<<<<<<<<
 *                                        data_variability, data_causality,
 *                                        alias_kind, initial)
 */
      __pyx_t_17 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_18 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_18);
      if (((__pyx_v_desc != NULL) != 0)) {
        __pyx_t_9 = __Pyx_decode_c_string(__pyx_v_desc, 0, strlen(__pyx_v_desc), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_16 = __pyx_t_9;
        __pyx_t_9 = 0;
      } else {
        __Pyx_INCREF(__pyx_kp_s__2);
        __pyx_t_16 = __pyx_kp_s__2;
      }

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

      /* "pyfmi\fmi.pyx":4137
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 *                                        alias_kind, initial)             # <<<<<<<<<<<<<<
 * 
 *         #Free the variable list
 */
      __pyx_t_5 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_12 = PyInt_FromLong(__pyx_v_initial); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);

      /* "pyfmi\fmi.pyx":4134
 *                 #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_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_18);
      __Pyx_GIVEREF(__pyx_t_18);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_17 = 0;
      __pyx_t_18 = 0;
      __pyx_t_16 = 0;
      __pyx_t_9 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_variable_dict, __pyx_v_name, __pyx_t_12) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L27;
    }
    __pyx_L27:;
    __pyx_L7_continue:;
  }

  /* "pyfmi\fmi.pyx":4140
 * 
 *         #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":4142
 *         FMIL.fmi2_import_free_variable_list(variable_list)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_references(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_variable_dict);
  __pyx_r = __pyx_v_variable_dict;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":4002
 * 
 * 
 *     def get_model_variables(self, type = None, include_alias = True,             # <<<<<<<<<<<<<<
 *                              causality = None,   variability = None,
 *                             only_start = False,   only_fixed = False,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_model_variables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XDECREF(__pyx_v_filter_list);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_57get_variable_references(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_56get_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_57get_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_56get_variable_references(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":4170
 *             [r,i,b,s,e] = model.get_value_references()
 *         """
 *         vr_real = self._save_real_variables_val             # <<<<<<<<<<<<<<
 *         vr_int  = self._save_int_variables_val
 *         vr_bool = self._save_bool_variables_val
 */
  __pyx_t_1 = __pyx_v_self->_save_real_variables_val;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_vr_real = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":4172
 *         vr_real = self._save_real_variables_val
 *         vr_int  = self._save_int_variables_val
 *         vr_bool = self._save_bool_variables_val             # <<<<<<<<<<<<<<
 * 
 *         get_str_var = self.get_model_variables(type=3)
 */
  __pyx_t_1 = __pyx_v_self->_save_bool_variables_val;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_vr_bool = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4174
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_model_variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4174; __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 = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4174; __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_get_str_var = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4175
 * 
 *         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 = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_get_str_var, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_6(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_value_reference); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_vr_str = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4177
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_model_variables); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __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_1); __pyx_t_1 = 0;
  __pyx_v_get_enum_var = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4178
 * 
 *         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_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_get_enum_var, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __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_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_value_reference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_vr_enum = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4180
 *         vr_enum = [e.value_reference for e in get_enum_var.values()]
 * 
 *         return vr_real, vr_int, vr_bool, vr_str, vr_enum             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_value_reference_t get_variable_valueref(self, variable_name) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_vr_real);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vr_real);
  __Pyx_GIVEREF(__pyx_v_vr_real);
  __Pyx_INCREF(__pyx_v_vr_int);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_vr_int);
  __Pyx_GIVEREF(__pyx_v_vr_int);
  __Pyx_INCREF(__pyx_v_vr_bool);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_vr_bool);
  __Pyx_GIVEREF(__pyx_v_vr_bool);
  __Pyx_INCREF(__pyx_v_vr_str);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_vr_str);
  __Pyx_GIVEREF(__pyx_v_vr_str);
  __Pyx_INCREF(__pyx_v_vr_enum);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_vr_enum);
  __Pyx_GIVEREF(__pyx_v_vr_enum);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.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":4182
 *         return vr_real, vr_int, vr_bool, vr_str, vr_enum
 * 
 *     cpdef FMIL.fmi2_value_reference_t get_variable_valueref(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Extract the ValueReference given a variable name.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_59get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static fmi2_value_reference_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_value_reference_t __pyx_v_vr;
  char *__pyx_v_variablename;
  fmi2_value_reference_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  fmi2_value_reference_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_valueref", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_valueref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __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_valueref)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __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_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (fmi2_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4198
 *         cdef FMIL.fmi2_value_reference_t  vr
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4198; __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_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":4202
 * 
 *         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_8 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":4203
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         vr =  FMIL.fmi2_import_get_variable_vr(variable)
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4203; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 4203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":4204
 *         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":4206
 *         vr =  FMIL.fmi2_import_get_variable_vr(variable)
 * 
 *         return vr             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_base_type_enu_t get_variable_data_type(self, variable_name) except *:
 */
  __pyx_r = __pyx_v_vr;
  goto __pyx_L0;

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_58get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_value_reference_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_valueref", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_valueref(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __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 = 4182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":4208
 *         return vr
 * 
 *     cpdef FMIL.fmi2_base_type_enu_t get_variable_data_type(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get data type of variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static fmi2_base_type_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_base_type_enu_t __pyx_v_type;
  char *__pyx_v_variablename;
  fmi2_base_type_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  fmi2_base_type_enu_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_data_type", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_data_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4208; __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_data_type)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4208; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4208; __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_3); __pyx_t_3 = 0;
      __pyx_t_6 = ((fmi2_base_type_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4224
 *         cdef FMIL.fmi2_base_type_enu_t    type
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4224; __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_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":4228
 * 
 *         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_8 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":4229
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":4231
 *             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":4233
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 * 
 *         return type             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_description(self, variable_name):
 */
  __pyx_r = __pyx_v_type;
  goto __pyx_L0;

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_data_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_60get_variable_data_type[] = "\n        Get data type of variable.\n\n        Parameter::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The type of the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_data_type (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_60get_variable_data_type(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_60get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_base_type_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_data_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_data_type(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4208; __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 = 4208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":4235
 *         return type
 * 
 *     cpdef get_variable_description(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the description of a given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  char *__pyx_v_desc;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_description", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_description); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4235; __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_description)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4235; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4235; __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_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":4251
 *         cdef char* desc
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __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_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":4255
 * 
 *         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_7 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":4256
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         desc = FMIL.fmi2_import_get_variable_description(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":4258
 *             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":4260
 *         desc = FMIL.fmi2_import_get_variable_description(variable)
 * 
 *         return desc if desc != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_variability_enu_t get_variable_variability(self, variable_name) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_desc != NULL) != 0)) {
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_desc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_s__2);
    __pyx_t_1 = __pyx_kp_s__2;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_62get_variable_description[] = "\n        Get the description of a given variable.\n\n        Parameter::\n\n            variable_name --\n                The name of the variable\n\n        Returns::\n\n            The description of the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_description (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_62get_variable_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_62get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_description", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_description(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":4262
 *         return desc if desc != NULL else ""
 * 
 *     cpdef FMIL.fmi2_variability_enu_t get_variable_variability(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get variability of the variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_65get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static fmi2_variability_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_variability_enu_t __pyx_v_variability;
  char *__pyx_v_variablename;
  fmi2_variability_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  fmi2_variability_enu_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_variability", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_variability); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_65get_variable_variability)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __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_3); __pyx_t_3 = 0;
      __pyx_t_6 = ((fmi2_variability_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4279
 *         cdef FMIL.fmi2_variability_enu_t variability
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4279; __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_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":4283
 * 
 *         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_8 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":4284
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         variability = FMIL.fmi2_import_get_variability(variable)
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":4285
 *         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":4287
 *         variability = FMIL.fmi2_import_get_variability(variable)
 * 
 *         return variability             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_initial_enu_t get_variable_initial(self, variable_name) except *:
 */
  __pyx_r = __pyx_v_variability;
  goto __pyx_L0;

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_variability", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_65get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_64get_variable_variability[] = "\n        Get variability of the variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The variability of the variable: CONSTANT(0), FIXED(1),\n            TUNABLE(2), DISCRETE(3), CONTINUOUS(4) or UNKNOWN(5)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_65get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_variability (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_64get_variable_variability(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_64get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_variability_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_variability", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_variability(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __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 = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":4289
 *         return variability
 * 
 *     cpdef FMIL.fmi2_initial_enu_t get_variable_initial(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get initial of the variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67get_variable_initial(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static fmi2_initial_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_initial(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_initial_enu_t __pyx_v_initial;
  char *__pyx_v_variablename;
  fmi2_initial_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  fmi2_initial_enu_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_initial", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_initial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67get_variable_initial)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4289; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4289; __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_3); __pyx_t_3 = 0;
      __pyx_t_6 = ((fmi2_initial_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4306
 *         cdef FMIL.fmi2_initial_enu_t initial
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4306; __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_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":4310
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 *         initial = FMIL.fmi2_import_get_initial(variable)
 */
  __pyx_t_8 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":4311
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         initial = FMIL.fmi2_import_get_initial(variable)
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4311; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 4311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":4312
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 *         initial = FMIL.fmi2_import_get_initial(variable)             # <<<<<<<<<<<<<<
 * 
 *         return initial
 */
  __pyx_v_initial = fmi2_import_get_initial(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4314
 *         initial = FMIL.fmi2_import_get_initial(variable)
 * 
 *         return initial             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_causality_enu_t get_variable_causality(self, variable_name) except *:
 */
  __pyx_r = __pyx_v_initial;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":4289
 *         return variability
 * 
 *     cpdef FMIL.fmi2_initial_enu_t get_variable_initial(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get initial of the variable.
 */

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_initial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67get_variable_initial(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_66get_variable_initial[] = "\n        Get initial of the variable.\n        \n        Parameters::\n        \n            variable_name --\n                The name of the variable.\n                \n        Returns::\n        \n            The initial of the variable: EXACT(0), APPROX(1), \n            CALCULATED(2), UNKNOWN(3)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67get_variable_initial(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_initial (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_66get_variable_initial(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_66get_variable_initial(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_initial_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_initial", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_initial(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4289; __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 = 4289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_initial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4316
 *         return initial
 * 
 *     cpdef FMIL.fmi2_causality_enu_t get_variable_causality(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get the causality of the variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_69get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static fmi2_causality_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_causality_enu_t __pyx_v_causality;
  char *__pyx_v_variablename;
  fmi2_causality_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  fmi2_causality_enu_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_causality", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_causality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_69get_variable_causality)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4316; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4316; __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_3); __pyx_t_3 = 0;
      __pyx_t_6 = ((fmi2_causality_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4333
 *         cdef FMIL.fmi2_causality_enu_t causality
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":4337
 * 
 *         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_8 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":4338
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         causality = FMIL.fmi2_import_get_causality(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4338; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 4338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":4340
 *             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":4342
 *         causality = FMIL.fmi2_import_get_causality(variable)
 * 
 *         return causality             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_start(self, variable_name):
 */
  __pyx_r = __pyx_v_causality;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":4316
 *         return initial
 * 
 *     cpdef FMIL.fmi2_causality_enu_t get_variable_causality(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get the causality of the variable.
 */

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_causality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_69get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_68get_variable_causality[] = "\n        Get the causality of the variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The variability of the variable, PARAMETER(0), INPUT(1),\n            OUTPUT(2), LOCAL(3), UNKNOWN(4)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_69get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_causality (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_68get_variable_causality(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_68get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_causality_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_causality", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_causality(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4316; __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 = 4316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":4344
 *         return causality
 * 
 *     cpdef get_variable_start(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the start value for the variable or else raises
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_base_type_enu_t __pyx_v_type;
  fmi2_import_integer_variable_t *__pyx_v_int_variable;
  fmi2_import_real_variable_t *__pyx_v_real_variable;
  fmi2_import_bool_variable_t *__pyx_v_bool_variable;
  fmi2_import_enum_variable_t *__pyx_v_enum_variable;
  fmi2_import_string_variable_t *__pyx_v_str_variable;
  int __pyx_v_status;
  fmi2_boolean_t __pyx_v_FMITRUE;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_start", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71get_variable_start)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4344; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4344; __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_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":4366
 *         cdef FMIL.fmi2_import_string_variable_t*  str_variable
 *         cdef int                                  status
 *         cdef FMIL.fmi2_boolean_t                  FMITRUE = 1             # <<<<<<<<<<<<<<
 * 
 *         variable_name = encode(variable_name)
 */
  __pyx_v_FMITRUE = 1;

  /* "pyfmi\fmi.pyx":4368
 *         cdef FMIL.fmi2_boolean_t                  FMITRUE = 1
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); 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);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":4372
 * 
 *         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_7 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":4373
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_variable_has_start(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4373; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 4373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":4375
 *             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":4377
 *         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_7 = ((__pyx_v_status == 0) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":4378
 * 
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_does_not_have_a_s, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4378; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4378; __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_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":4380
 *             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":4398
 *             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)
 */
  switch (__pyx_v_type) {

    /* "pyfmi\fmi.pyx":4382
 *         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)
 */
    case fmi2_base_type_real:

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

    /* "pyfmi\fmi.pyx":4386
 *             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)
 */
    case fmi2_base_type_int:

    /* "pyfmi\fmi.pyx":4387
 * 
 *         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":4388
 *         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 = __Pyx_PyInt_From_int(fmi2_import_get_integer_variable_start(__pyx_v_int_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":4390
 *             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
 */
    case fmi2_base_type_bool:

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

    /* "pyfmi\fmi.pyx":4394
 *             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)
 */
    case fmi2_base_type_enum:

    /* "pyfmi\fmi.pyx":4395
 * 
 *         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":4396
 *         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 = __Pyx_PyInt_From_int(fmi2_import_get_enum_variable_start(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":4398
 *             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)
 */
    case fmi2_base_type_str:

    /* "pyfmi\fmi.pyx":4399
 * 
 *         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":4400
 *         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 = __Pyx_PyBytes_FromString(fmi2_import_get_string_variable_start(__pyx_v_str_variable)); 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_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
    default:

    /* "pyfmi\fmi.pyx":4403
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self, variable_name):
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4403; __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 = 4403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_70get_variable_start[] = "\n        Returns the start value for the variable or else raises\n        FMUException.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable\n\n        Returns::\n\n            The start value.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_start (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_70get_variable_start(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_70get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_start(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":4405
 *             raise FMUException("Unknown variable type.")
 * 
 *     cpdef get_variable_max(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the maximum value for the given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_integer_variable_t *__pyx_v_int_variable;
  fmi2_import_real_variable_t *__pyx_v_real_variable;
  fmi2_import_enum_variable_t *__pyx_v_enum_variable;
  fmi2_base_type_enu_t __pyx_v_type;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_max", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_max); 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);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73get_variable_max)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4405; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4405; __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_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":4424
 *         cdef FMIL.fmi2_base_type_enu_t            type
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __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_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

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

    /* "pyfmi\fmi.pyx":4429
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4429; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":4431
 *             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":4441
 *             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)
 */
  switch (__pyx_v_type) {

    /* "pyfmi\fmi.pyx":4433
 *         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)
 */
    case fmi2_base_type_real:

    /* "pyfmi\fmi.pyx":4434
 * 
 *         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":4435
 *         if type == FMIL.fmi2_base_type_real:
 *             real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 *             return FMIL.fmi2_import_get_real_variable_max(real_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi2_base_type_int:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(fmi2_import_get_real_variable_max(__pyx_v_real_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":4437
 *             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)
 */
    case fmi2_base_type_int:

    /* "pyfmi\fmi.pyx":4438
 * 
 *         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":4439
 *         elif type == FMIL.fmi2_base_type_int:
 *             int_variable = FMIL.fmi2_import_get_variable_as_integer(variable)
 *             return FMIL.fmi2_import_get_integer_variable_max(int_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi2_base_type_enum:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_int(fmi2_import_get_integer_variable_max(__pyx_v_int_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":4441
 *             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)
 */
    case fmi2_base_type_enum:

    /* "pyfmi\fmi.pyx":4442
 * 
 *         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":4443
 *         elif type == FMIL.fmi2_base_type_enum:
 *             enum_variable = FMIL.fmi2_import_get_variable_as_enum(variable)
 *             return FMIL.fmi2_import_get_enum_variable_max(enum_variable)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_int(fmi2_import_get_enum_variable_max(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
    default:

    /* "pyfmi\fmi.pyx":4446
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self, variable_name):
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__127, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4446; __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 = 4446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_72get_variable_max[] = "\n        Returns the maximum value for the given variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The maximum value for the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_max (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_72get_variable_max(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_72get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_max", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_max(__pyx_v_self, __pyx_v_variable_name, 1); 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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":4448
 *             raise FMUException("The variable type does not have a maximum value.")
 * 
 *     cpdef get_variable_min(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the minimum value for the given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_75get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_integer_variable_t *__pyx_v_int_variable;
  fmi2_import_real_variable_t *__pyx_v_real_variable;
  fmi2_import_enum_variable_t *__pyx_v_enum_variable;
  fmi2_base_type_enu_t __pyx_v_type;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_min", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_variable_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_75get_variable_min)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4448; __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 = NULL;
        __Pyx_INCREF(__pyx_v_variable_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
        __Pyx_GIVEREF(__pyx_v_variable_name);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4448; __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_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":4467
 *         cdef FMIL.fmi2_base_type_enu_t            type
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4467; __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_DECREF_SET(__pyx_v_variable_name, __pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":4471
 * 
 *         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_7 = ((__pyx_v_variable == NULL) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":4472
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4472; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 4472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":4474
 *             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":4484
 *             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)
 */
  switch (__pyx_v_type) {

    /* "pyfmi\fmi.pyx":4476
 *         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)
 */
    case fmi2_base_type_real:

    /* "pyfmi\fmi.pyx":4477
 * 
 *         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":4478
 *         if type == FMIL.fmi2_base_type_real:
 *             real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 *             return FMIL.fmi2_import_get_real_variable_min(real_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi2_base_type_int:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(fmi2_import_get_real_variable_min(__pyx_v_real_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":4480
 *             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)
 */
    case fmi2_base_type_int:

    /* "pyfmi\fmi.pyx":4481
 * 
 *         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":4482
 *         elif type == FMIL.fmi2_base_type_int:
 *             int_variable = FMIL.fmi2_import_get_variable_as_integer(variable)
 *             return FMIL.fmi2_import_get_integer_variable_min(int_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi2_base_type_enum:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_int(fmi2_import_get_integer_variable_min(__pyx_v_int_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":4484
 *             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)
 */
    case fmi2_base_type_enum:

    /* "pyfmi\fmi.pyx":4485
 * 
 *         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":4486
 *         elif type == FMIL.fmi2_base_type_enum:
 *             enum_variable = FMIL.fmi2_import_get_variable_as_enum(variable)
 *             return FMIL.fmi2_import_get_enum_variable_min(enum_variable)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_int(fmi2_import_get_enum_variable_min(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
    default:

    /* "pyfmi\fmi.pyx":4489
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 *     def get_fmu_state(self):
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__128, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4489; __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 = 4489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_75get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_74get_variable_min[] = "\n        Returns the minimum value for the given variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The minimum value for the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_75get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_min (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_74get_variable_min(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_74get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_min", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_min(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":4491
 *             raise FMUException("The variable type does not have a minimum value.")
 * 
 *     def get_fmu_state(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a copy of the recent FMU-state and returns
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_77get_fmu_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_76get_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_77get_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_76get_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_76get_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":4505
 *             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 = 4505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":4491
 *             raise FMUException("The variable type does not have a minimum value.")
 * 
 *     def get_fmu_state(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a copy of the recent FMU-state and returns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_fmu_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_79set_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_78set_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_79set_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_78set_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_78set_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":4538
 *             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 = 4538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_fmu_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_81free_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_80free_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_81free_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_80free_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_80free_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":4571
 * 
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *         cdef int status
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.free_fmu_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_83serialize_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;
  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("serialize_fmu_state", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_serialize_fmu_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4583; __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_83serialize_fmu_state)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_state); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4583; __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 = NULL;
        __Pyx_INCREF(__pyx_v_state);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_state);
        __Pyx_GIVEREF(__pyx_v_state);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__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":4599
 *             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 = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

  /* function exit code */
  __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_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_83serialize_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_82serialize_fmu_state[] = "\n        Serialize the data referenced by the input argument.\n\n        Parameters::\n\n            state --\n                A FMU-state.\n\n        Returns::\n            A vector with the serialized FMU-state.\n\n        Example::\n            FMU_state = Model.get_fmu_state()\n            serialized_fmu = Model.serialize_fmu_state(FMU_state)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_83serialize_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_82serialize_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_82serialize_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 = __pyx_f_5pyfmi_3fmi_13FMUModelBase2_serialize_fmu_state(__pyx_v_self, __pyx_v_state, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":4623
 *         return serialized_fmu
 * 
 *     cpdef deserialize_fmu_state(self, serialized_fmu):             # <<<<<<<<<<<<<<
 *         """
 *         De-serialize the provided byte-vector and returns the corresponding FMU-state.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_85deserialize_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;
  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("deserialize_fmu_state", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_deserialize_fmu_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_85deserialize_fmu_state)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_serialized_fmu); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4623; __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 = NULL;
        __Pyx_INCREF(__pyx_v_serialized_fmu);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_serialized_fmu);
        __Pyx_GIVEREF(__pyx_v_serialized_fmu);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__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":4642
 *             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 = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

  /* function exit code */
  __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_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_85deserialize_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_serialized_fmu); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_84deserialize_fmu_state[] = "\n        De-serialize the provided byte-vector and returns the corresponding FMU-state.\n\n        Parameters::\n\n            serialized_fmu--\n                A serialized FMU-state.\n\n        Returns::\n\n            A deserialized FMU-state.\n\n        Example::\n\n            FMU_state = Model.get_fmu_state()\n            serialized_fmu = Model.serialize_fmu_state(FMU_state)\n            FMU_state = Model.deserialize_fmu_state(serialized_fmu)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_85deserialize_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_84deserialize_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_serialized_fmu));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_84deserialize_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 = __pyx_f_5pyfmi_3fmi_13FMUModelBase2_deserialize_fmu_state(__pyx_v_self, __pyx_v_serialized_fmu, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":4656
 *         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_87serialized_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;
  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("serialized_fmu_state_size", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_serialized_fmu_state_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4656; __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_87serialized_fmu_state_size)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_state); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4656; __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 = NULL;
        __Pyx_INCREF(__pyx_v_state);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_state);
        __Pyx_GIVEREF(__pyx_v_state);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4656; __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_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":4669
 *             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 = 4669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":4656
 *         return state
 * 
 *     cpdef serialized_fmu_state_size(self, state):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the required size of a vector needed to serialize the specified FMU-state
 */

  /* function exit code */
  __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_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_87serialized_fmu_state_size(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_86serialized_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_87serialized_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_86serialized_fmu_state_size(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_86serialized_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 = __pyx_f_5pyfmi_3fmi_13FMUModelBase2_serialized_fmu_state_size(__pyx_v_self, __pyx_v_state, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_89get_ode_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_88get_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_89get_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_88get_ode_sizes(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_88get_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":4699
 *             [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_From_size_t(__pyx_v_self->_nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_size_t(__pyx_v_self->_nEventIndicators); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4699; __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 = 4699; __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 = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":4701
 *         return self._nContinuousStates, self._nEventIndicators
 * 
 *     def get_default_experiment_start_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment start time as defined the XML
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_91get_default_experiment_start_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_90get_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_91get_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_90get_default_experiment_start_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_90get_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":4706
 *         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 = 4706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":4701
 *         return self._nContinuousStates, self._nEventIndicators
 * 
 *     def get_default_experiment_start_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment start time as defined the XML
 */

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_93get_default_experiment_stop_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_92get_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_93get_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_92get_default_experiment_stop_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_92get_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":4713
 *         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 = 4713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_95get_default_experiment_tolerance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_94get_default_experiment_tolerance[] = "\n        Returns the default experiment tolerance as defined in the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_95get_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_94get_default_experiment_tolerance(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_94get_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":4720
 *         description.
 *         """
 *         return FMIL.fmi2_import_get_default_experiment_tolerance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def get_default_experiment_step(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(fmi2_import_get_default_experiment_tolerance(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":4722
 *         return FMIL.fmi2_import_get_default_experiment_tolerance(self._fmu)
 * 
 *     def get_default_experiment_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment step as defined in the XML
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_97get_default_experiment_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_96get_default_experiment_step[] = "\n        Returns the default experiment step as defined in the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_97get_default_experiment_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_experiment_step (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_96get_default_experiment_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":4727
 *         description.
 *         """
 *         return FMIL.fmi2_import_get_default_experiment_step(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def _convert_filter(self, expression):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(fmi2_import_get_default_experiment_step(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":4722
 *         return FMIL.fmi2_import_get_default_experiment_tolerance(self._fmu)
 * 
 *     def get_default_experiment_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment step as defined in the XML
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_default_experiment_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_99_convert_filter(PyObject *__pyx_v_self, PyObject *__pyx_v_expression); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_98_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_99_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_98_convert_filter(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_expression));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_98_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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_convert_filter", 0);

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

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

    /* "pyfmi\fmi.pyx":4745
 *         regexp = []
 *         if isinstance(expression,str):
 *             regex = fnmatch.translate(expression)             # <<<<<<<<<<<<<<
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_fnmatch); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_translate); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_expression); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_expression);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_expression);
      __Pyx_GIVEREF(__pyx_v_expression);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_regex = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":4746
 *         if isinstance(expression,str):
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]             # <<<<<<<<<<<<<<
 *         elif isinstance(expression,list):
 *             for i in expression:
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_regex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4746; __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 = NULL;
      __Pyx_INCREF(__pyx_v_regex);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_regex);
      __Pyx_GIVEREF(__pyx_v_regex);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __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 = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_regexp, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;
    goto __pyx_L3;
  }

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

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

      /* "pyfmi\fmi.pyx":4749
 *         elif isinstance(expression,list):
 *             for i in expression:
 *                 regex = fnmatch.translate(i)             # <<<<<<<<<<<<<<
 *                 regexp.append(re.compile(regex))
 *         else:
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_fnmatch); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_translate); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_regex, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":4750
 *             for i in expression:
 *                 regex = fnmatch.translate(i)
 *                 regexp.append(re.compile(regex))             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("Unknown input.")
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_regex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4750; __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 = NULL;
        __Pyx_INCREF(__pyx_v_regex);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_regex);
        __Pyx_GIVEREF(__pyx_v_regex);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_regexp, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":4748
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):
 *             for i in expression:             # <<<<<<<<<<<<<<
 *                 regex = fnmatch.translate(i)
 *                 regexp.append(re.compile(regex))
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":4752
 *                 regexp.append(re.compile(regex))
 *         else:
 *             raise FMUException("Unknown input.")             # <<<<<<<<<<<<<<
 *         return regexp
 * 
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4752; __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 = 4752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4753
 *         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(__pyx_v_regexp);
  __pyx_r = __pyx_v_regexp;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._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":4755
 *         return regexp
 * 
 *     cdef _add_scalar_variables(self, FMIL.fmi2_import_variable_list_t*   variable_list):             # <<<<<<<<<<<<<<
 *         """
 *         Helper method to create scalar variables from a variable list.
 */

static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2__add_scalar_variables(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, fmi2_import_variable_list_t *__pyx_v_variable_list) {
  size_t __pyx_v_variable_list_size;
  PyObject *__pyx_v_variable_dict = NULL;
  size_t __pyx_v_i;
  fmi2_import_variable_t *__pyx_v_variable;
  PyObject *__pyx_v_scalar_variable = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_add_scalar_variables", 0);

  /* "pyfmi\fmi.pyx":4760
 *         """
 *         cdef FMIL.size_t             variable_list_size
 *         variable_dict = OrderedDict()             # <<<<<<<<<<<<<<
 * 
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_variable_dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4762
 *         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":4764
 *         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_4 = __pyx_v_variable_list_size;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "pyfmi\fmi.pyx":4766
 *         for i in range(variable_list_size):
 * 
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)             # <<<<<<<<<<<<<<
 *             scalar_variable = self._add_scalar_variable(variable)
 *             variable_dict[scalar_variable.name] = scalar_variable
 */
    __pyx_v_variable = fmi2_import_get_variable(__pyx_v_variable_list, __pyx_v_i);

    /* "pyfmi\fmi.pyx":4767
 * 
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 *             scalar_variable = self._add_scalar_variable(variable)             # <<<<<<<<<<<<<<
 *             variable_dict[scalar_variable.name] = scalar_variable
 * 
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_vtab)->_add_scalar_variable(__pyx_v_self, __pyx_v_variable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_scalar_variable, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":4768
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 *             scalar_variable = self._add_scalar_variable(variable)
 *             variable_dict[scalar_variable.name] = scalar_variable             # <<<<<<<<<<<<<<
 * 
 *             """
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_scalar_variable, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(__pyx_v_variable_dict, __pyx_t_1, __pyx_v_scalar_variable) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4785
 *             """
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     cdef _add_scalar_variable(self, FMIL.fmi2_import_variable_t* variable):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_variable_dict);
  __pyx_r = __pyx_v_variable_dict;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._add_scalar_variables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XDECREF(__pyx_v_scalar_variable);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4787
 *         return variable_dict
 * 
 *     cdef _add_scalar_variable(self, FMIL.fmi2_import_variable_t* variable):             # <<<<<<<<<<<<<<
 * 
 *         alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 */

static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2__add_scalar_variable(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, fmi2_import_variable_t *__pyx_v_variable) {
  fmi2_variable_alias_kind_enu_t __pyx_v_alias_kind;
  char *__pyx_v_name;
  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_causality_enu_t __pyx_v_data_causality;
  char *__pyx_v_desc;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  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("_add_scalar_variable", 0);

  /* "pyfmi\fmi.pyx":4789
 *     cdef _add_scalar_variable(self, FMIL.fmi2_import_variable_t* variable):
 * 
 *         alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *         name             = FMIL.fmi2_import_get_variable_name(variable)
 *         value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 */
  __pyx_v_alias_kind = fmi2_import_get_variable_alias_kind(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4790
 * 
 *         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":4791
 *         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":4792
 *         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_v_data_type = fmi2_import_get_variable_base_type(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4793
 *         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_v_data_variability = fmi2_import_get_variability(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4794
 *         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_v_data_causality = fmi2_import_get_causality(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4795
 *         data_variability = FMIL.fmi2_import_get_variability(variable)
 *         data_causality   = FMIL.fmi2_import_get_causality(variable)
 *         desc             = FMIL.fmi2_import_get_variable_description(variable)             # <<<<<<<<<<<<<<
 * 
 *         return ScalarVariable2(name, value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 */
  __pyx_v_desc = fmi2_import_get_variable_description(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4797
 *         desc             = FMIL.fmi2_import_get_variable_description(variable)
 * 
 *         return ScalarVariable2(name, value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",             # <<<<<<<<<<<<<<
 *                                     data_variability, data_causality,
 *                                     alias_kind)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (((__pyx_v_desc != NULL) != 0)) {
    __pyx_t_5 = __Pyx_decode_c_string(__pyx_v_desc, 0, strlen(__pyx_v_desc), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __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_kp_s__2);
    __pyx_t_4 = __pyx_kp_s__2;
  }

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

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

  /* "pyfmi\fmi.pyx":4797
 *         desc             = FMIL.fmi2_import_get_variable_description(variable)
 * 
 *         return ScalarVariable2(name, value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",             # <<<<<<<<<<<<<<
 *                                     data_variability, data_causality,
 *                                     alias_kind)
 */
  __pyx_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __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_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":4787
 *         return variable_dict
 * 
 *     cdef _add_scalar_variable(self, FMIL.fmi2_import_variable_t* variable):             # <<<<<<<<<<<<<<
 * 
 *         alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 */

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._add_scalar_variable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_101get_derivatives_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_100get_derivatives_list[] = "\n        Returns a dictionary with the states derivatives.\n\n        Returns::\n\n            An ordered dictionary with the derivative variables.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_101get_derivatives_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_derivatives_list (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_100get_derivatives_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_100get_derivatives_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  fmi2_import_variable_list_t *__pyx_v_variable_list;
  PyObject *__pyx_v_variable_dict = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_derivatives_list", 0);

  /* "pyfmi\fmi.pyx":4811
 *         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":4812
 * 
 *         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) != 0);
  if (__pyx_t_1) {

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

  /* "pyfmi\fmi.pyx":4815
 *             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 = 4815; __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":4818
 * 
 *         #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":4820
 *         FMIL.fmi2_import_free_variable_list(variable_list)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_state_space_representation(self, A=True, B=True, C=True, D=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_variable_dict);
  __pyx_r = __pyx_v_variable_dict;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_derivatives_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4822
 *         return variable_dict
 * 
 *     def get_state_space_representation(self, A=True, B=True, C=True, D=True):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a state space representation of the model. I.e::
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_103get_state_space_representation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_102get_state_space_representation[] = "\n        Returns a state space representation of the model. I.e::\n        \n            der(x) = Ax + Bu\n                y  = Cx + Du\n                \n        Which of the matrices to be returned can be choosen by the arguments.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_103get_state_space_representation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_A = 0;
  PyObject *__pyx_v_B = 0;
  PyObject *__pyx_v_C = 0;
  PyObject *__pyx_v_D = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_state_space_representation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_C,&__pyx_n_s_D,0};
    PyObject* values[4] = {0,0,0,0};
    values[0] = ((PyObject *)Py_True);
    values[1] = ((PyObject *)Py_True);
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_A);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_B);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_C);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_D);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_state_space_representation") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_A = values[0];
    __pyx_v_B = values[1];
    __pyx_v_C = values[2];
    __pyx_v_D = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_state_space_representation", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_state_space_representation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_102get_state_space_representation(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_D);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_102get_state_space_representation(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_D) {
  PyArrayObject *__pyx_v_v = 0;
  int __pyx_v_i;
  PyObject *__pyx_v_states = NULL;
  PyObject *__pyx_v_derivatives = NULL;
  PyObject *__pyx_v_inputs = NULL;
  PyObject *__pyx_v_outputs = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  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("get_state_space_representation", 0);
  __Pyx_INCREF(__pyx_v_A);
  __Pyx_INCREF(__pyx_v_B);
  __Pyx_INCREF(__pyx_v_C);
  __Pyx_INCREF(__pyx_v_D);

  /* "pyfmi\fmi.pyx":4834
 *         cdef int i
 * 
 *         if A:             # <<<<<<<<<<<<<<
 *             if self._states_references is None:
 *                 states                       = self.get_states_list()
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_A); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4835
 * 
 *         if A:
 *             if self._states_references is None:             # <<<<<<<<<<<<<<
 *                 states                       = self.get_states_list()
 *                 self._states_references      = [s.value_reference for s in states.values()]
 */
    __pyx_t_1 = (__pyx_v_self->_states_references == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4836
 *         if A:
 *             if self._states_references is None:
 *                 states                       = self.get_states_list()             # <<<<<<<<<<<<<<
 *                 self._states_references      = [s.value_reference for s in states.values()]
 *             if self._derivatives_references is None:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_states_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_states = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4837
 *             if self._states_references is None:
 *                 states                       = self.get_states_list()
 *                 self._states_references      = [s.value_reference for s in states.values()]             # <<<<<<<<<<<<<<
 *             if self._derivatives_references is None:
 *                 derivatives                  = self.get_derivatives_list()
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_states, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_8(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_value_reference); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_states_references);
      __Pyx_DECREF(__pyx_v_self->_states_references);
      __pyx_v_self->_states_references = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "pyfmi\fmi.pyx":4838
 *                 states                       = self.get_states_list()
 *                 self._states_references      = [s.value_reference for s in states.values()]
 *             if self._derivatives_references is None:             # <<<<<<<<<<<<<<
 *                 derivatives                  = self.get_derivatives_list()
 *                 self._derivatives_references = [s.value_reference for s in derivatives.values()]
 */
    __pyx_t_2 = (__pyx_v_self->_derivatives_references == Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":4839
 *                 self._states_references      = [s.value_reference for s in states.values()]
 *             if self._derivatives_references is None:
 *                 derivatives                  = self.get_derivatives_list()             # <<<<<<<<<<<<<<
 *                 self._derivatives_references = [s.value_reference for s in derivatives.values()]
 *             if self._A is None:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_derivatives_list); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_derivatives = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4840
 *             if self._derivatives_references is None:
 *                 derivatives                  = self.get_derivatives_list()
 *                 self._derivatives_references = [s.value_reference for s in derivatives.values()]             # <<<<<<<<<<<<<<
 *             if self._A is None:
 *                 self._A = N.zeros((len(self._derivatives_references), len(self._states_references)))
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_derivatives, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_8(__pyx_t_4);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_value_reference); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_derivatives_references);
      __Pyx_DECREF(__pyx_v_self->_derivatives_references);
      __pyx_v_self->_derivatives_references = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "pyfmi\fmi.pyx":4841
 *                 derivatives                  = self.get_derivatives_list()
 *                 self._derivatives_references = [s.value_reference for s in derivatives.values()]
 *             if self._A is None:             # <<<<<<<<<<<<<<
 *                 self._A = N.zeros((len(self._derivatives_references), len(self._states_references)))
 *             A = self._A
 */
    __pyx_t_1 = (__pyx_v_self->_A == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4842
 *                 self._derivatives_references = [s.value_reference for s in derivatives.values()]
 *             if self._A is None:
 *                 self._A = N.zeros((len(self._derivatives_references), len(self._states_references)))             # <<<<<<<<<<<<<<
 *             A = self._A
 * 
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_v_self->_derivatives_references;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_7 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __pyx_v_self->_states_references;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4842; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4842; __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_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_A);
      __Pyx_DECREF(__pyx_v_self->_A);
      __pyx_v_self->_A = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "pyfmi\fmi.pyx":4843
 *             if self._A is None:
 *                 self._A = N.zeros((len(self._derivatives_references), len(self._states_references)))
 *             A = self._A             # <<<<<<<<<<<<<<
 * 
 *             v = N.zeros(len(self._states_references))
 */
    __pyx_t_3 = __pyx_v_self->_A;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_A, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4845
 *             A = self._A
 * 
 *             v = N.zeros(len(self._states_references))             # <<<<<<<<<<<<<<
 *             for i in range(len(self._states_references)):
 *                 v[i] = 1.0
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_v_self->_states_references;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_7 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __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 = 4845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_v = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4846
 * 
 *             v = N.zeros(len(self._states_references))
 *             for i in range(len(self._states_references)):             # <<<<<<<<<<<<<<
 *                 v[i] = 1.0
 *                 A[:, i] = self.get_directional_derivative(self._states_references, self._derivatives_references, v)
 */
    __pyx_t_3 = __pyx_v_self->_states_references;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_7; __pyx_t_10+=1) {
      __pyx_v_i = __pyx_t_10;

      /* "pyfmi\fmi.pyx":4847
 *             v = N.zeros(len(self._states_references))
 *             for i in range(len(self._states_references)):
 *                 v[i] = 1.0             # <<<<<<<<<<<<<<
 *                 A[:, i] = self.get_directional_derivative(self._states_references, self._derivatives_references, v)
 *                 v[i] = 0.0
 */
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_float_1_0, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "pyfmi\fmi.pyx":4848
 *             for i in range(len(self._states_references)):
 *                 v[i] = 1.0
 *                 A[:, i] = self.get_directional_derivative(self._states_references, self._derivatives_references, v)             # <<<<<<<<<<<<<<
 *                 v[i] = 0.0
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_directional_derivative); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_5 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_6) {
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_self->_states_references);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_11, __pyx_v_self->_states_references);
      __Pyx_GIVEREF(__pyx_v_self->_states_references);
      __Pyx_INCREF(__pyx_v_self->_derivatives_references);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_11, __pyx_v_self->_derivatives_references);
      __Pyx_GIVEREF(__pyx_v_self->_derivatives_references);
      __Pyx_INCREF(((PyObject *)__pyx_v_v));
      PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_11, ((PyObject *)__pyx_v_v));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_v));
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4848; __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_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_slice__131);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__131);
      __Pyx_GIVEREF(__pyx_slice__131);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_A, __pyx_t_5, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4849
 *                 v[i] = 1.0
 *                 A[:, i] = self.get_directional_derivative(self._states_references, self._derivatives_references, v)
 *                 v[i] = 0.0             # <<<<<<<<<<<<<<
 * 
 *         if B:
 */
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_float_0_0, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4851
 *                 v[i] = 0.0
 * 
 *         if B:             # <<<<<<<<<<<<<<
 *             if self._inputs_references is None:
 *                 inputs                       = self.get_input_list()
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_B); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4852
 * 
 *         if B:
 *             if self._inputs_references is None:             # <<<<<<<<<<<<<<
 *                 inputs                       = self.get_input_list()
 *                 self._inputs_references      = [s.value_reference for s in inputs.values()]
 */
    __pyx_t_2 = (__pyx_v_self->_inputs_references == Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":4853
 *         if B:
 *             if self._inputs_references is None:
 *                 inputs                       = self.get_input_list()             # <<<<<<<<<<<<<<
 *                 self._inputs_references      = [s.value_reference for s in inputs.values()]
 *             if self._derivatives_references is None:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_input_list); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_inputs = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4854
 *             if self._inputs_references is None:
 *                 inputs                       = self.get_input_list()
 *                 self._inputs_references      = [s.value_reference for s in inputs.values()]             # <<<<<<<<<<<<<<
 *             if self._derivatives_references is None:
 *                 derivatives                  = self.get_derivatives_list()
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_inputs, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_8(__pyx_t_4);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_value_reference); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_inputs_references);
      __Pyx_DECREF(__pyx_v_self->_inputs_references);
      __pyx_v_self->_inputs_references = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "pyfmi\fmi.pyx":4855
 *                 inputs                       = self.get_input_list()
 *                 self._inputs_references      = [s.value_reference for s in inputs.values()]
 *             if self._derivatives_references is None:             # <<<<<<<<<<<<<<
 *                 derivatives                  = self.get_derivatives_list()
 *                 self._derivatives_references = [s.value_reference for s in derivatives.values()]
 */
    __pyx_t_1 = (__pyx_v_self->_derivatives_references == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4856
 *                 self._inputs_references      = [s.value_reference for s in inputs.values()]
 *             if self._derivatives_references is None:
 *                 derivatives                  = self.get_derivatives_list()             # <<<<<<<<<<<<<<
 *                 self._derivatives_references = [s.value_reference for s in derivatives.values()]
 *             if self._B is None:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_derivatives_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_derivatives, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4857
 *             if self._derivatives_references is None:
 *                 derivatives                  = self.get_derivatives_list()
 *                 self._derivatives_references = [s.value_reference for s in derivatives.values()]             # <<<<<<<<<<<<<<
 *             if self._B is None:
 *                 self._B = N.zeros((len(self._derivatives_references), len(self._inputs_references)))
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_derivatives, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_8(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_value_reference); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_derivatives_references);
      __Pyx_DECREF(__pyx_v_self->_derivatives_references);
      __pyx_v_self->_derivatives_references = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L17;
    }
    __pyx_L17:;

    /* "pyfmi\fmi.pyx":4858
 *                 derivatives                  = self.get_derivatives_list()
 *                 self._derivatives_references = [s.value_reference for s in derivatives.values()]
 *             if self._B is None:             # <<<<<<<<<<<<<<
 *                 self._B = N.zeros((len(self._derivatives_references), len(self._inputs_references)))
 *             B = self._B
 */
    __pyx_t_2 = (__pyx_v_self->_B == Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":4859
 *                 self._derivatives_references = [s.value_reference for s in derivatives.values()]
 *             if self._B is None:
 *                 self._B = N.zeros((len(self._derivatives_references), len(self._inputs_references)))             # <<<<<<<<<<<<<<
 *             B = self._B
 * 
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_v_self->_derivatives_references;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_7 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __pyx_v_self->_inputs_references;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4859; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4859; __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_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_B);
      __Pyx_DECREF(__pyx_v_self->_B);
      __pyx_v_self->_B = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L20;
    }
    __pyx_L20:;

    /* "pyfmi\fmi.pyx":4860
 *             if self._B is None:
 *                 self._B = N.zeros((len(self._derivatives_references), len(self._inputs_references)))
 *             B = self._B             # <<<<<<<<<<<<<<
 * 
 *             v = N.zeros(len(self._inputs_references))
 */
    __pyx_t_3 = __pyx_v_self->_B;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_B, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4862
 *             B = self._B
 * 
 *             v = N.zeros(len(self._inputs_references))             # <<<<<<<<<<<<<<
 *             for i in range(len(self._inputs_references)):
 *                 v[i] = 1.0
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_v_self->_inputs_references;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_7 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 4862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4863
 * 
 *             v = N.zeros(len(self._inputs_references))
 *             for i in range(len(self._inputs_references)):             # <<<<<<<<<<<<<<
 *                 v[i] = 1.0
 *                 B[:, i] = self.get_directional_derivative(self._inputs_references, self._derivatives_references, v)
 */
    __pyx_t_3 = __pyx_v_self->_inputs_references;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_7; __pyx_t_10+=1) {
      __pyx_v_i = __pyx_t_10;

      /* "pyfmi\fmi.pyx":4864
 *             v = N.zeros(len(self._inputs_references))
 *             for i in range(len(self._inputs_references)):
 *                 v[i] = 1.0             # <<<<<<<<<<<<<<
 *                 B[:, i] = self.get_directional_derivative(self._inputs_references, self._derivatives_references, v)
 *                 v[i] = 0.0
 */
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_float_1_0, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "pyfmi\fmi.pyx":4865
 *             for i in range(len(self._inputs_references)):
 *                 v[i] = 1.0
 *                 B[:, i] = self.get_directional_derivative(self._inputs_references, self._derivatives_references, v)             # <<<<<<<<<<<<<<
 *                 v[i] = 0.0
 *         if C:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_directional_derivative); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_4 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_6) {
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_self->_inputs_references);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_11, __pyx_v_self->_inputs_references);
      __Pyx_GIVEREF(__pyx_v_self->_inputs_references);
      __Pyx_INCREF(__pyx_v_self->_derivatives_references);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_11, __pyx_v_self->_derivatives_references);
      __Pyx_GIVEREF(__pyx_v_self->_derivatives_references);
      __Pyx_INCREF(((PyObject *)__pyx_v_v));
      PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_11, ((PyObject *)__pyx_v_v));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_v));
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __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 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_slice__132);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__132);
      __Pyx_GIVEREF(__pyx_slice__132);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_B, __pyx_t_4, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4866
 *                 v[i] = 1.0
 *                 B[:, i] = self.get_directional_derivative(self._inputs_references, self._derivatives_references, v)
 *                 v[i] = 0.0             # <<<<<<<<<<<<<<
 *         if C:
 *             if self._states_references is None:
 */
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_float_0_0, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pyfmi\fmi.pyx":4867
 *                 B[:, i] = self.get_directional_derivative(self._inputs_references, self._derivatives_references, v)
 *                 v[i] = 0.0
 *         if C:             # <<<<<<<<<<<<<<
 *             if self._states_references is None:
 *                 states                       = self.get_states_list()
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_C); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4868
 *                 v[i] = 0.0
 *         if C:
 *             if self._states_references is None:             # <<<<<<<<<<<<<<
 *                 states                       = self.get_states_list()
 *                 self._states_references      = [s.value_reference for s in states.values()]
 */
    __pyx_t_1 = (__pyx_v_self->_states_references == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4869
 *         if C:
 *             if self._states_references is None:
 *                 states                       = self.get_states_list()             # <<<<<<<<<<<<<<
 *                 self._states_references      = [s.value_reference for s in states.values()]
 *             if self._outputs_references is None:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_states_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_states, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4870
 *             if self._states_references is None:
 *                 states                       = self.get_states_list()
 *                 self._states_references      = [s.value_reference for s in states.values()]             # <<<<<<<<<<<<<<
 *             if self._outputs_references is None:
 *                 outputs                      = self.get_output_list()
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_states, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_8(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_value_reference); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_states_references);
      __Pyx_DECREF(__pyx_v_self->_states_references);
      __pyx_v_self->_states_references = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L24;
    }
    __pyx_L24:;

    /* "pyfmi\fmi.pyx":4871
 *                 states                       = self.get_states_list()
 *                 self._states_references      = [s.value_reference for s in states.values()]
 *             if self._outputs_references is None:             # <<<<<<<<<<<<<<
 *                 outputs                      = self.get_output_list()
 *                 self._outputs_references     = [s.value_reference for s in outputs.values()]
 */
    __pyx_t_2 = (__pyx_v_self->_outputs_references == Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":4872
 *                 self._states_references      = [s.value_reference for s in states.values()]
 *             if self._outputs_references is None:
 *                 outputs                      = self.get_output_list()             # <<<<<<<<<<<<<<
 *                 self._outputs_references     = [s.value_reference for s in outputs.values()]
 *             if self._C is None:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_output_list); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_outputs = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4873
 *             if self._outputs_references is None:
 *                 outputs                      = self.get_output_list()
 *                 self._outputs_references     = [s.value_reference for s in outputs.values()]             # <<<<<<<<<<<<<<
 *             if self._C is None:
 *                 self._C = N.zeros((len(self._outputs_references), len(self._states_references)))
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_outputs, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_8(__pyx_t_4);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_value_reference); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_outputs_references);
      __Pyx_DECREF(__pyx_v_self->_outputs_references);
      __pyx_v_self->_outputs_references = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L27;
    }
    __pyx_L27:;

    /* "pyfmi\fmi.pyx":4874
 *                 outputs                      = self.get_output_list()
 *                 self._outputs_references     = [s.value_reference for s in outputs.values()]
 *             if self._C is None:             # <<<<<<<<<<<<<<
 *                 self._C = N.zeros((len(self._outputs_references), len(self._states_references)))
 *             C = self._C
 */
    __pyx_t_1 = (__pyx_v_self->_C == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4875
 *                 self._outputs_references     = [s.value_reference for s in outputs.values()]
 *             if self._C is None:
 *                 self._C = N.zeros((len(self._outputs_references), len(self._states_references)))             # <<<<<<<<<<<<<<
 *             C = self._C
 * 
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_v_self->_outputs_references;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_7 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __pyx_v_self->_states_references;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4875; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4875; __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_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_C);
      __Pyx_DECREF(__pyx_v_self->_C);
      __pyx_v_self->_C = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L30;
    }
    __pyx_L30:;

    /* "pyfmi\fmi.pyx":4876
 *             if self._C is None:
 *                 self._C = N.zeros((len(self._outputs_references), len(self._states_references)))
 *             C = self._C             # <<<<<<<<<<<<<<
 * 
 *             v = N.zeros(len(self._states_references))
 */
    __pyx_t_3 = __pyx_v_self->_C;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_C, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4878
 *             C = self._C
 * 
 *             v = N.zeros(len(self._states_references))             # <<<<<<<<<<<<<<
 *             for i in range(len(self._states_references)):
 *                 v[i] = 1.0
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_v_self->_states_references;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_7 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __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 = 4878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4879
 * 
 *             v = N.zeros(len(self._states_references))
 *             for i in range(len(self._states_references)):             # <<<<<<<<<<<<<<
 *                 v[i] = 1.0
 *                 C[:, i] = self.get_directional_derivative(self._states_references, self._outputs_references, v)
 */
    __pyx_t_3 = __pyx_v_self->_states_references;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_7; __pyx_t_10+=1) {
      __pyx_v_i = __pyx_t_10;

      /* "pyfmi\fmi.pyx":4880
 *             v = N.zeros(len(self._states_references))
 *             for i in range(len(self._states_references)):
 *                 v[i] = 1.0             # <<<<<<<<<<<<<<
 *                 C[:, i] = self.get_directional_derivative(self._states_references, self._outputs_references, v)
 *                 v[i] = 0.0
 */
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_float_1_0, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "pyfmi\fmi.pyx":4881
 *             for i in range(len(self._states_references)):
 *                 v[i] = 1.0
 *                 C[:, i] = self.get_directional_derivative(self._states_references, self._outputs_references, v)             # <<<<<<<<<<<<<<
 *                 v[i] = 0.0
 *         if D:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_directional_derivative); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_5 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_6) {
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_self->_states_references);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_11, __pyx_v_self->_states_references);
      __Pyx_GIVEREF(__pyx_v_self->_states_references);
      __Pyx_INCREF(__pyx_v_self->_outputs_references);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_11, __pyx_v_self->_outputs_references);
      __Pyx_GIVEREF(__pyx_v_self->_outputs_references);
      __Pyx_INCREF(((PyObject *)__pyx_v_v));
      PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_11, ((PyObject *)__pyx_v_v));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_v));
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4881; __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_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_slice__133);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__133);
      __Pyx_GIVEREF(__pyx_slice__133);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_C, __pyx_t_5, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4882
 *                 v[i] = 1.0
 *                 C[:, i] = self.get_directional_derivative(self._states_references, self._outputs_references, v)
 *                 v[i] = 0.0             # <<<<<<<<<<<<<<
 *         if D:
 *             if self._inputs_references is None:
 */
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_float_0_0, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L23;
  }
  __pyx_L23:;

  /* "pyfmi\fmi.pyx":4883
 *                 C[:, i] = self.get_directional_derivative(self._states_references, self._outputs_references, v)
 *                 v[i] = 0.0
 *         if D:             # <<<<<<<<<<<<<<
 *             if self._inputs_references is None:
 *                 inputs                       = self.get_input_list()
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_D); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4884
 *                 v[i] = 0.0
 *         if D:
 *             if self._inputs_references is None:             # <<<<<<<<<<<<<<
 *                 inputs                       = self.get_input_list()
 *                 self._inputs_references      = [s.value_reference for s in inputs.values()]
 */
    __pyx_t_2 = (__pyx_v_self->_inputs_references == Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":4885
 *         if D:
 *             if self._inputs_references is None:
 *                 inputs                       = self.get_input_list()             # <<<<<<<<<<<<<<
 *                 self._inputs_references      = [s.value_reference for s in inputs.values()]
 *             if self._outputs_references is None:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_input_list); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_inputs, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4886
 *             if self._inputs_references is None:
 *                 inputs                       = self.get_input_list()
 *                 self._inputs_references      = [s.value_reference for s in inputs.values()]             # <<<<<<<<<<<<<<
 *             if self._outputs_references is None:
 *                 outputs                      = self.get_output_list()
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_inputs, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_8(__pyx_t_4);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_value_reference); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_inputs_references);
      __Pyx_DECREF(__pyx_v_self->_inputs_references);
      __pyx_v_self->_inputs_references = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L34;
    }
    __pyx_L34:;

    /* "pyfmi\fmi.pyx":4887
 *                 inputs                       = self.get_input_list()
 *                 self._inputs_references      = [s.value_reference for s in inputs.values()]
 *             if self._outputs_references is None:             # <<<<<<<<<<<<<<
 *                 outputs                      = self.get_output_list()
 *                 self._outputs_references     = [s.value_reference for s in outputs.values()]
 */
    __pyx_t_1 = (__pyx_v_self->_outputs_references == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4888
 *                 self._inputs_references      = [s.value_reference for s in inputs.values()]
 *             if self._outputs_references is None:
 *                 outputs                      = self.get_output_list()             # <<<<<<<<<<<<<<
 *                 self._outputs_references     = [s.value_reference for s in outputs.values()]
 *             if self._D is None:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_output_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_outputs, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4889
 *             if self._outputs_references is None:
 *                 outputs                      = self.get_output_list()
 *                 self._outputs_references     = [s.value_reference for s in outputs.values()]             # <<<<<<<<<<<<<<
 *             if self._D is None:
 *                 self._D = N.zeros((len(self._outputs_references), len(self._inputs_references)))
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_outputs, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_8(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_value_reference); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_outputs_references);
      __Pyx_DECREF(__pyx_v_self->_outputs_references);
      __pyx_v_self->_outputs_references = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L37;
    }
    __pyx_L37:;

    /* "pyfmi\fmi.pyx":4890
 *                 outputs                      = self.get_output_list()
 *                 self._outputs_references     = [s.value_reference for s in outputs.values()]
 *             if self._D is None:             # <<<<<<<<<<<<<<
 *                 self._D = N.zeros((len(self._outputs_references), len(self._inputs_references)))
 *             D = self._D
 */
    __pyx_t_2 = (__pyx_v_self->_D == Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":4891
 *                 self._outputs_references     = [s.value_reference for s in outputs.values()]
 *             if self._D is None:
 *                 self._D = N.zeros((len(self._outputs_references), len(self._inputs_references)))             # <<<<<<<<<<<<<<
 *             D = self._D
 * 
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_v_self->_outputs_references;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_7 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __pyx_v_self->_inputs_references;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4891; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, 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_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_D);
      __Pyx_DECREF(__pyx_v_self->_D);
      __pyx_v_self->_D = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L40;
    }
    __pyx_L40:;

    /* "pyfmi\fmi.pyx":4892
 *             if self._D is None:
 *                 self._D = N.zeros((len(self._outputs_references), len(self._inputs_references)))
 *             D = self._D             # <<<<<<<<<<<<<<
 * 
 *             v = N.zeros(len(self._inputs_references))
 */
    __pyx_t_3 = __pyx_v_self->_D;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_D, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4894
 *             D = self._D
 * 
 *             v = N.zeros(len(self._inputs_references))             # <<<<<<<<<<<<<<
 *             for i in range(len(self._inputs_references)):
 *                 v[i] = 1.0
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_v_self->_inputs_references;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_7 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 4894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4895
 * 
 *             v = N.zeros(len(self._inputs_references))
 *             for i in range(len(self._inputs_references)):             # <<<<<<<<<<<<<<
 *                 v[i] = 1.0
 *                 D[:, i] = self.get_directional_derivative(self._inputs_references, self._outputs_references, v)
 */
    __pyx_t_3 = __pyx_v_self->_inputs_references;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_7; __pyx_t_10+=1) {
      __pyx_v_i = __pyx_t_10;

      /* "pyfmi\fmi.pyx":4896
 *             v = N.zeros(len(self._inputs_references))
 *             for i in range(len(self._inputs_references)):
 *                 v[i] = 1.0             # <<<<<<<<<<<<<<
 *                 D[:, i] = self.get_directional_derivative(self._inputs_references, self._outputs_references, v)
 *                 v[i] = 0.0
 */
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_float_1_0, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "pyfmi\fmi.pyx":4897
 *             for i in range(len(self._inputs_references)):
 *                 v[i] = 1.0
 *                 D[:, i] = self.get_directional_derivative(self._inputs_references, self._outputs_references, v)             # <<<<<<<<<<<<<<
 *                 v[i] = 0.0
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_directional_derivative); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_4 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_6) {
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_self->_inputs_references);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_11, __pyx_v_self->_inputs_references);
      __Pyx_GIVEREF(__pyx_v_self->_inputs_references);
      __Pyx_INCREF(__pyx_v_self->_outputs_references);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_11, __pyx_v_self->_outputs_references);
      __Pyx_GIVEREF(__pyx_v_self->_outputs_references);
      __Pyx_INCREF(((PyObject *)__pyx_v_v));
      PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_11, ((PyObject *)__pyx_v_v));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_v));
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_slice__134);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__134);
      __Pyx_GIVEREF(__pyx_slice__134);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_D, __pyx_t_4, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":4898
 *                 v[i] = 1.0
 *                 D[:, i] = self.get_directional_derivative(self._inputs_references, self._outputs_references, v)
 *                 v[i] = 0.0             # <<<<<<<<<<<<<<
 * 
 *         return A,B,C,D
 */
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_float_0_0, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L33;
  }
  __pyx_L33:;

  /* "pyfmi\fmi.pyx":4900
 *                 v[i] = 0.0
 * 
 *         return A,B,C,D             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_A);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_A);
  __Pyx_GIVEREF(__pyx_v_A);
  __Pyx_INCREF(__pyx_v_B);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_B);
  __Pyx_GIVEREF(__pyx_v_B);
  __Pyx_INCREF(__pyx_v_C);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_C);
  __Pyx_GIVEREF(__pyx_v_C);
  __Pyx_INCREF(__pyx_v_D);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_D);
  __Pyx_GIVEREF(__pyx_v_D);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":4822
 *         return variable_dict
 * 
 *     def get_state_space_representation(self, A=True, B=True, C=True, D=True):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a state space representation of the model. I.e::
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_state_space_representation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_states);
  __Pyx_XDECREF(__pyx_v_derivatives);
  __Pyx_XDECREF(__pyx_v_inputs);
  __Pyx_XDECREF(__pyx_v_outputs);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_A);
  __Pyx_XDECREF(__pyx_v_B);
  __Pyx_XDECREF(__pyx_v_C);
  __Pyx_XDECREF(__pyx_v_D);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_105get_states_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_104get_states_list[] = "\n        Returns a dictionary with the states.\n\n        Returns::\n\n            An ordered dictionary with the state variables.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_105get_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_104get_states_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_104get_states_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  fmi2_import_variable_list_t *__pyx_v_variable_list;
  size_t __pyx_v_variable_list_size;
  PyObject *__pyx_v_variable_dict = NULL;
  size_t __pyx_v_i;
  fmi2_import_variable_t *__pyx_v_der_variable;
  fmi2_import_real_variable_t *__pyx_v_variable;
  PyObject *__pyx_v_scalar_variable = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  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_states_list", 0);

  /* "pyfmi\fmi.pyx":4913
 *         cdef FMIL.fmi2_import_variable_list_t*   variable_list
 *         cdef FMIL.size_t             variable_list_size
 *         variable_dict = OrderedDict()             # <<<<<<<<<<<<<<
 * 
 *         variable_list = FMIL.fmi2_import_get_derivatives_list(self._fmu)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_variable_dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4915
 *         variable_dict = OrderedDict()
 * 
 *         variable_list = FMIL.fmi2_import_get_derivatives_list(self._fmu)             # <<<<<<<<<<<<<<
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 * 
 */
  __pyx_v_variable_list = fmi2_import_get_derivatives_list(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":4916
 * 
 *         variable_list = FMIL.fmi2_import_get_derivatives_list(self._fmu)
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         if variable_list == NULL:
 */
  __pyx_v_variable_list_size = fmi2_import_get_variable_list_size(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":4918
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 * 
 *         if variable_list == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The returned derivatives states list is NULL.")
 * 
 */
  __pyx_t_4 = ((__pyx_v_variable_list == NULL) != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4919
 * 
 *         if variable_list == NULL:
 *             raise FMUException("The returned derivatives states list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); 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);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__135, NULL); 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(__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 = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":4921
 *             raise FMUException("The returned derivatives states list is NULL.")
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 *             der_variable = FMIL.fmi2_import_get_variable(variable_list, i)
 *             variable     = FMIL.fmi2_import_get_real_variable_derivative_of(<FMIL.fmi2_import_real_variable_t*>der_variable)
 */
  __pyx_t_5 = __pyx_v_variable_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":4922
 * 
 *         for i in range(variable_list_size):
 *             der_variable = FMIL.fmi2_import_get_variable(variable_list, i)             # <<<<<<<<<<<<<<
 *             variable     = FMIL.fmi2_import_get_real_variable_derivative_of(<FMIL.fmi2_import_real_variable_t*>der_variable)
 * 
 */
    __pyx_v_der_variable = fmi2_import_get_variable(__pyx_v_variable_list, __pyx_v_i);

    /* "pyfmi\fmi.pyx":4923
 *         for i in range(variable_list_size):
 *             der_variable = FMIL.fmi2_import_get_variable(variable_list, i)
 *             variable     = FMIL.fmi2_import_get_real_variable_derivative_of(<FMIL.fmi2_import_real_variable_t*>der_variable)             # <<<<<<<<<<<<<<
 * 
 *             scalar_variable = self._add_scalar_variable(<FMIL.fmi2_import_variable_t*>variable)
 */
    __pyx_v_variable = fmi2_import_get_real_variable_derivative_of(((fmi2_import_real_variable_t *)__pyx_v_der_variable));

    /* "pyfmi\fmi.pyx":4925
 *             variable     = FMIL.fmi2_import_get_real_variable_derivative_of(<FMIL.fmi2_import_real_variable_t*>der_variable)
 * 
 *             scalar_variable = self._add_scalar_variable(<FMIL.fmi2_import_variable_t*>variable)             # <<<<<<<<<<<<<<
 *             variable_dict[scalar_variable.name] = scalar_variable
 * 
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_vtab)->_add_scalar_variable(__pyx_v_self, ((fmi2_import_variable_t *)__pyx_v_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_scalar_variable, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":4926
 * 
 *             scalar_variable = self._add_scalar_variable(<FMIL.fmi2_import_variable_t*>variable)
 *             variable_dict[scalar_variable.name] = scalar_variable             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_scalar_variable, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(PyObject_SetItem(__pyx_v_variable_dict, __pyx_t_2, __pyx_v_scalar_variable) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "pyfmi\fmi.pyx":4932
 * 
 *         #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":4934
 *         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;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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_XDECREF(__pyx_v_scalar_variable);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_107get_input_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_106get_input_list[] = "\n        Returns a dictionary with input variables\n\n        Returns::\n\n            An ordered dictionary with the (real) (continuous) input variables.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_107get_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_106get_input_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_106get_input_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_v_variable_dict = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_input_list", 0);

  /* "pyfmi\fmi.pyx":4944
 *             An ordered dictionary with the (real) (continuous) input variables.
 *         """
 *         variable_dict = self.get_model_variables(type=FMI2_REAL, include_alias = False,             # <<<<<<<<<<<<<<
 *                              causality = FMI2_INPUT,   variability = FMI2_CONTINUOUS)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_model_variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4944; __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 = 4944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_REAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_include_alias, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":4945
 *         """
 *         variable_dict = self.get_model_variables(type=FMI2_REAL, include_alias = False,
 *                              causality = FMI2_INPUT,   variability = FMI2_CONTINUOUS)             # <<<<<<<<<<<<<<
 * 
 *         return variable_dict
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_INPUT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_causality, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_CONTINUOUS); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variability, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4944
 *             An ordered dictionary with the (real) (continuous) input variables.
 *         """
 *         variable_dict = self.get_model_variables(type=FMI2_REAL, include_alias = False,             # <<<<<<<<<<<<<<
 *                              causality = FMI2_INPUT,   variability = FMI2_CONTINUOUS)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4944; __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_variable_dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4947
 *                              causality = FMI2_INPUT,   variability = FMI2_CONTINUOUS)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_output_list(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_variable_dict);
  __pyx_r = __pyx_v_variable_dict;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_input_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_109get_output_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_108get_output_list[] = "\n        Returns a dictionary with output variables\n\n        Returns::\n\n            An ordered dictionary with the (real) (continuous) output variables.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_109get_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_108get_output_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_108get_output_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_v_variable_dict = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_output_list", 0);

  /* "pyfmi\fmi.pyx":4957
 *             An ordered dictionary with the (real) (continuous) output variables.
 *         """
 *         variable_dict = self.get_model_variables(type=FMI2_REAL, include_alias = False,             # <<<<<<<<<<<<<<
 *                              causality = FMI2_OUTPUT,   variability = FMI2_CONTINUOUS)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_model_variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __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 = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_REAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_include_alias, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":4958
 *         """
 *         variable_dict = self.get_model_variables(type=FMI2_REAL, include_alias = False,
 *                              causality = FMI2_OUTPUT,   variability = FMI2_CONTINUOUS)             # <<<<<<<<<<<<<<
 * 
 *         return variable_dict
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_OUTPUT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_causality, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_CONTINUOUS); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variability, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4957
 *             An ordered dictionary with the (real) (continuous) output variables.
 *         """
 *         variable_dict = self.get_model_variables(type=FMI2_REAL, include_alias = False,             # <<<<<<<<<<<<<<
 *                              causality = FMI2_OUTPUT,   variability = FMI2_CONTINUOUS)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_variable_dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4960
 *                              causality = FMI2_OUTPUT,   variability = FMI2_CONTINUOUS)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_directional_derivative(self, var_ref, func_ref, v):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_variable_dict);
  __pyx_r = __pyx_v_variable_dict;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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;
}

/* "pyfmi\fmi.pyx":4962
 *         return variable_dict
 * 
 *     def get_directional_derivative(self, var_ref, func_ref, v):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the directional derivatives of the functions with respect
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_111get_directional_derivative(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_110get_directional_derivative[] = "\n        Returns the directional derivatives of the functions with respect\n        to the given variables and in the given direction.\n        In other words, it returns linear combinations of the partial derivatives\n        of the given functions with respect to the selected variables.\n        The point of evaluation is the current time-point.\n\n        Parameters::\n\n            var_ref --\n                A list of variable references that the partial derivatives\n                will be calculated with respect to.\n\n            func_ref --\n                A list of function references for which the partial derivatives will be calculated.\n\n            v --\n                A seed vector specifying the linear combination of the partial derivatives.\n\n        Returns::\n\n            value --\n                A vector with the directional derivatives (linear combination of\n                partial derivatives) evaluated in the current time point.\n\n\n        Example::\n\n            states = model.get_states_list()\n            states_references = [s.value_reference for s in states.values()]\n            derivatives = model.get_derivatives_list()\n            derivatives_references = [d.value_reference for d in derivatives.values()]\n            model.get_directional_derivative(states_references, derivatives_references, v)\n\n            This returns Jv, where J is the Jacobian and v the seed vector.\n\n            Also, only a subset of the derivatives and and states can be selected:\n\n            model.get_directional_derivative(var_ref = [0,1], func_ref = [2,3], v = [1,2])\n\n            This returns a vector with two values where:\n\n            values[0] = (df2/dv0) * 1 + (df2/dv1) * 2\n            values[1] = (df3/dv0) * 1 + (df3/dv1) * 2\n\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_111get_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_directional_derivative (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_var_ref,&__pyx_n_s_func_ref,&__pyx_n_s_v,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var_ref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func_ref)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_directional_derivative", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4962; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_directional_derivative", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4962; __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 = 4962; __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 = 4962; __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_110get_directional_derivative(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_var_ref, __pyx_v_func_ref, __pyx_v_v);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_110get_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;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dv;
  __Pyx_Buffer __pyx_pybuffer_dv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dz;
  __Pyx_Buffer __pyx_pybuffer_dz;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v_ref;
  __Pyx_Buffer __pyx_pybuffer_v_ref;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_z_ref;
  __Pyx_Buffer __pyx_pybuffer_z_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  PyArrayObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  fmi2_value_reference_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  fmi2_real_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  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":5014
 * 
 *         #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_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5014; __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 = 5014; __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 = 5014; __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 = 5014; __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 = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5014; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 5014; __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| PyBUF_WRITABLE, 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 = 5014; __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":5015
 *         #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_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __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 = 5015; __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 = 5015; __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 = 5015; __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 = 5015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5015; __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_DECREF(__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 = 5015; __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| PyBUF_WRITABLE, 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 = 5015; __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":5016
 *         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_GetModuleGlobalName(__pyx_n_s_N); 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_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __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 = 5016; __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 = 5016; __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 = 5016; __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 = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 5016; __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| PyBUF_WRITABLE, 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 = 5016; __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":5018
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dv    = N.zeros(len(v),        dtype = N.double)
 *         #output array
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dz    = N.zeros(len(func_ref), dtype = N.double)             # <<<<<<<<<<<<<<
 * 
 *         if not self._provides_directional_derivatives():
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); 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_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 = 5018; __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 = 5018; __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 = 5018; __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 = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__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 = 5018; __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 = 5018; __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":5020
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dz    = N.zeros(len(func_ref), dtype = N.double)
 * 
 *         if not self._provides_directional_derivatives():             # <<<<<<<<<<<<<<
 *             raise FMUException('This FMU does not provide directional derivatives')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provides_directional_derivative); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_12 = ((!__pyx_t_11) != 0);
  if (__pyx_t_12) {

    /* "pyfmi\fmi.pyx":5021
 * 
 *         if not self._provides_directional_derivatives():
 *             raise FMUException('This FMU does not provide directional derivatives')             # <<<<<<<<<<<<<<
 * 
 *         if len(var_ref) != len(v):
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); 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);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__136, 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_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 = 5021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5023
 *             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 = 5023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((__pyx_t_3 != __pyx_t_13) != 0);
  if (__pyx_t_12) {

    /* "pyfmi\fmi.pyx":5024
 * 
 *         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_GetModuleGlobalName(__pyx_n_s_FMUException); 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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__137, NULL); 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_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5026
 *             raise FMUException('The length of the list with variables (var_ref) and the seed vector (V) are not equal')
 * 
 *         for i in range(len(var_ref)):             # <<<<<<<<<<<<<<
 *             v_ref[i] = var_ref[i]
 *             dv[i] = v[i]
 */
  __pyx_t_13 = PyObject_Length(__pyx_v_var_ref); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_13; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pyfmi\fmi.pyx":5027
 * 
 *         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 = __Pyx_GetItemInt(__pyx_v_var_ref, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_14 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (fmi2_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_16 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_v_ref.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v_ref.diminfo[0].shape)) __pyx_t_16 = 0;
    if (unlikely(__pyx_t_16 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_16);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi2_value_reference_t *, __pyx_pybuffernd_v_ref.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_v_ref.diminfo[0].strides) = __pyx_t_14;

    /* "pyfmi\fmi.pyx":5028
 *         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 = __Pyx_GetItemInt(__pyx_v_v, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5028; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_16 = -1;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_pybuffernd_dv.diminfo[0].shape;
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_16 = 0;
    } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_dv.diminfo[0].shape)) __pyx_t_16 = 0;
    if (unlikely(__pyx_t_16 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_16);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi2_real_t *, __pyx_pybuffernd_dv.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dv.diminfo[0].strides) = __pyx_t_17;
  }

  /* "pyfmi\fmi.pyx":5029
 *             v_ref[i] = var_ref[i]
 *             dv[i] = v[i]
 *         for j in range(len(func_ref)):             # <<<<<<<<<<<<<<
 *             z_ref[j] = func_ref[j]
 * 
 */
  __pyx_t_13 = PyObject_Length(__pyx_v_func_ref); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_13; __pyx_t_3+=1) {
    __pyx_v_j = __pyx_t_3;

    /* "pyfmi\fmi.pyx":5030
 *             dv[i] = v[i]
 *         for j in range(len(func_ref)):
 *             z_ref[j] = func_ref[j]             # <<<<<<<<<<<<<<
 * 
 *         nv = len(v_ref)
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_func_ref, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5030; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_14 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (fmi2_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_19 = __pyx_v_j;
    __pyx_t_16 = -1;
    if (__pyx_t_19 < 0) {
      __pyx_t_19 += __pyx_pybuffernd_z_ref.diminfo[0].shape;
      if (unlikely(__pyx_t_19 < 0)) __pyx_t_16 = 0;
    } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_z_ref.diminfo[0].shape)) __pyx_t_16 = 0;
    if (unlikely(__pyx_t_16 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_16);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi2_value_reference_t *, __pyx_pybuffernd_z_ref.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_z_ref.diminfo[0].strides) = __pyx_t_14;
  }

  /* "pyfmi\fmi.pyx":5032
 *             z_ref[j] = func_ref[j]
 * 
 *         nv = len(v_ref)             # <<<<<<<<<<<<<<
 *         nz = len(z_ref)
 * 
 */
  __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_v_ref)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nv = __pyx_t_13;

  /* "pyfmi\fmi.pyx":5033
 * 
 *         nv = len(v_ref)
 *         nz = len(z_ref)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_directional_derivative(self._fmu, <FMIL.fmi2_value_reference_t*> v_ref.data, nv, <FMIL.fmi2_value_reference_t*> z_ref.data, nz, <FMIL.fmi2_real_t*> dv.data, <FMIL.fmi2_real_t*> dz.data)
 */
  __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_z_ref)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nz = __pyx_t_13;

  /* "pyfmi\fmi.pyx":5035
 *         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":5037
 *         status = FMIL.fmi2_import_get_directional_derivative(self._fmu, <FMIL.fmi2_value_reference_t*> v_ref.data, nv, <FMIL.fmi2_value_reference_t*> z_ref.data, nz, <FMIL.fmi2_real_t*> dv.data, <FMIL.fmi2_real_t*> dz.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured while getting the directional derivative, see the log for possible more information')
 * 
 */
  __pyx_t_12 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_12) {

    /* "pyfmi\fmi.pyx":5038
 * 
 *         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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_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 = 5038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5040
 *             raise FMUException('An error occured while getting the directional derivative, see the log for possible more information')
 * 
 *         return dz             # <<<<<<<<<<<<<<
 * 
 *     def get_version(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_dz));
  __pyx_r = ((PyObject *)__pyx_v_dz);
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":4962
 *         return variable_dict
 * 
 *     def get_directional_derivative(self, var_ref, func_ref, v):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the directional derivatives of the functions with respect
 */

  /* function exit code */
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_113get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_112get_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_113get_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_112get_version(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_112get_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":5055
 *             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":5056
 *         """
 *         cdef char* version = FMIL.fmi2_import_get_version(self._fmu)
 *         return version             # <<<<<<<<<<<<<<
 * 
 *     def get_model_version(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_115get_model_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_114get_model_version[] = "\n        Returns the version fo the FMU.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_115get_model_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_version (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_114get_model_version(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_114get_model_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_version;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_model_version", 0);

  /* "pyfmi\fmi.pyx":5063
 *         """
 *         cdef char* version
 *         version = FMIL.fmi2_import_get_model_version(self._fmu)             # <<<<<<<<<<<<<<
 *         return version if version != NULL else ""
 * 
 */
  __pyx_v_version = fmi2_import_get_model_version(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5064
 *         cdef char* version
 *         version = FMIL.fmi2_import_get_model_version(self._fmu)
 *         return version if version != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_name(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_version != NULL) != 0)) {
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_s__2);
    __pyx_t_1 = __pyx_kp_s__2;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_model_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5066
 *         return version if version != NULL else ""
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model name as used in the modeling environment.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_117get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_116get_name[] = "\n        Return the model name as used in the modeling environment.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_117get_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_116get_name(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* "pyfmi\fmi.pyx":5066
 *         return version if version != NULL else ""
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model name as used in the modeling environment.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_119get_author(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_118get_author[] = "\n        Return the name and organization of the model author.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_119get_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_118get_author(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_118get_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":5077
 *         """
 *         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":5078
 *         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) != 0)) {
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_author); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_s__2);
    __pyx_t_1 = __pyx_kp_s__2;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_121get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_120get_description[] = "\n        Return the model description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_121get_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_120get_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_120get_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":5085
 *         """
 *         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":5086
 *         cdef char* desc
 *         desc = FMIL.fmi2_import_get_description(self._fmu)
 *         return desc if desc != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_copyright(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_desc != NULL) != 0)) {
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_desc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_s__2);
    __pyx_t_1 = __pyx_kp_s__2;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_123get_copyright(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_122get_copyright[] = "\n        Return the model copyright.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_123get_copyright(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_copyright (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_122get_copyright(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_122get_copyright(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_copyright;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_copyright", 0);

  /* "pyfmi\fmi.pyx":5093
 *         """
 *         cdef char* copyright
 *         copyright = FMIL.fmi2_import_get_copyright(self._fmu)             # <<<<<<<<<<<<<<
 *         return copyright if copyright != NULL else ""
 * 
 */
  __pyx_v_copyright = fmi2_import_get_copyright(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5094
 *         cdef char* copyright
 *         copyright = FMIL.fmi2_import_get_copyright(self._fmu)
 *         return copyright if copyright != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_license(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_copyright != NULL) != 0)) {
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_copyright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_s__2);
    __pyx_t_1 = __pyx_kp_s__2;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_copyright", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_125get_license(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_124get_license[] = "\n        Return the model license.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_125get_license(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_license (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_124get_license(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_124get_license(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_license;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_license", 0);

  /* "pyfmi\fmi.pyx":5101
 *         """
 *         cdef char* license
 *         license = FMIL.fmi2_import_get_license(self._fmu)             # <<<<<<<<<<<<<<
 *         return license if license != NULL else ""
 * 
 */
  __pyx_v_license = fmi2_import_get_license(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5102
 *         cdef char* license
 *         license = FMIL.fmi2_import_get_license(self._fmu)
 *         return license if license != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_generation_tool(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_license != NULL) != 0)) {
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_license); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_s__2);
    __pyx_t_1 = __pyx_kp_s__2;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_license", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_127get_generation_tool(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_126get_generation_tool[] = "\n        Return the model generation tool.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_127get_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_126get_generation_tool(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_126get_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":5109
 *         """
 *         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":5110
 *         cdef char* gen
 *         gen = FMIL.fmi2_import_get_generation_tool(self._fmu)
 *         return gen if gen != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_generation_date_and_time(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_gen != NULL) != 0)) {
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_gen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_s__2);
    __pyx_t_1 = __pyx_kp_s__2;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":5112
 *         return gen if gen != NULL else ""
 * 
 *     def get_generation_date_and_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model generation date and time.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_129get_generation_date_and_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_128get_generation_date_and_time[] = "\n        Return the model generation date and time.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_129get_generation_date_and_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_generation_date_and_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_128get_generation_date_and_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_128get_generation_date_and_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_gen;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_generation_date_and_time", 0);

  /* "pyfmi\fmi.pyx":5117
 *         """
 *         cdef char* gen
 *         gen = FMIL.fmi2_import_get_generation_date_and_time(self._fmu)             # <<<<<<<<<<<<<<
 *         return gen if gen != NULL else ""
 * 
 */
  __pyx_v_gen = fmi2_import_get_generation_date_and_time(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5118
 *         cdef char* gen
 *         gen = FMIL.fmi2_import_get_generation_date_and_time(self._fmu)
 *         return gen if gen != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_guid(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_gen != NULL) != 0)) {
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_gen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_kp_s__2);
    __pyx_t_1 = __pyx_kp_s__2;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5112
 *         return gen if gen != NULL else ""
 * 
 *     def get_generation_date_and_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model generation date and time.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_generation_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_131get_guid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_130get_guid[] = "\n        Return the model GUID.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_131get_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_130get_guid(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_130get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_v_guid = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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_guid", 0);

  /* "pyfmi\fmi.pyx":5124
 *         Return the model GUID.
 *         """
 *         guid = decode(FMIL.fmi2_import_get_GUID(self._fmu))             # <<<<<<<<<<<<<<
 *         return guid
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBytes_FromString(fmi2_import_get_GUID(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5124; __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 = NULL;
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_guid = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5125
 *         """
 *         guid = decode(FMIL.fmi2_import_get_GUID(self._fmu))
 *         return guid             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_naming_convention(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_guid);
  __pyx_r = __pyx_v_guid;
  goto __pyx_L0;

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

  /* function exit code */
  __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_AddTraceback("pyfmi.fmi.FMUModelBase2.get_guid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_guid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_133get_variable_naming_convention(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_132get_variable_naming_convention[] = "\n        Return the variable naming convention.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_133get_variable_naming_convention(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_naming_convention (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_132get_variable_naming_convention(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_132get_variable_naming_convention(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  fmi2_variable_naming_convension_enu_t __pyx_v_conv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_naming_convention", 0);

  /* "pyfmi\fmi.pyx":5132
 *         """
 *         cdef FMIL.fmi2_variable_naming_convension_enu_t conv
 *         conv = FMIL.fmi2_import_get_naming_convention(self._fmu)             # <<<<<<<<<<<<<<
 *         if conv == FMIL.fmi2_naming_enu_flat:
 *             return "flat"
 */
  __pyx_v_conv = fmi2_import_get_naming_convention(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5135
 *         if conv == FMIL.fmi2_naming_enu_flat:
 *             return "flat"
 *         elif conv == FMIL.fmi2_naming_enu_structured:             # <<<<<<<<<<<<<<
 *             return "structured"
 *         else:
 */
  switch (__pyx_v_conv) {

    /* "pyfmi\fmi.pyx":5133
 *         cdef FMIL.fmi2_variable_naming_convension_enu_t conv
 *         conv = FMIL.fmi2_import_get_naming_convention(self._fmu)
 *         if conv == FMIL.fmi2_naming_enu_flat:             # <<<<<<<<<<<<<<
 *             return "flat"
 *         elif conv == FMIL.fmi2_naming_enu_structured:
 */
    case fmi2_naming_enu_flat:

    /* "pyfmi\fmi.pyx":5134
 *         conv = FMIL.fmi2_import_get_naming_convention(self._fmu)
 *         if conv == FMIL.fmi2_naming_enu_flat:
 *             return "flat"             # <<<<<<<<<<<<<<
 *         elif conv == FMIL.fmi2_naming_enu_structured:
 *             return "structured"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_flat);
    __pyx_r = __pyx_n_s_flat;
    goto __pyx_L0;
    break;

    /* "pyfmi\fmi.pyx":5135
 *         if conv == FMIL.fmi2_naming_enu_flat:
 *             return "flat"
 *         elif conv == FMIL.fmi2_naming_enu_structured:             # <<<<<<<<<<<<<<
 *             return "structured"
 *         else:
 */
    case fmi2_naming_enu_structured:

    /* "pyfmi\fmi.pyx":5136
 *             return "flat"
 *         elif conv == FMIL.fmi2_naming_enu_structured:
 *             return "structured"             # <<<<<<<<<<<<<<
 *         else:
 *             return "unknown"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_structured);
    __pyx_r = __pyx_n_s_structured;
    goto __pyx_L0;
    break;
    default:

    /* "pyfmi\fmi.pyx":5138
 *             return "structured"
 *         else:
 *             return "unknown"             # <<<<<<<<<<<<<<
 * 
 *     def get_identifier(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_unknown);
    __pyx_r = __pyx_n_s_unknown;
    goto __pyx_L0;
    break;
  }

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

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5140
 *             return "unknown"
 * 
 *     def get_identifier(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model identifier, name of binary model file and prefix in
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_135get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_134get_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_135get_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_134get_identifier(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":5145
 *         the C-function names of the model.
 *         """
 *         return self._modelId             # <<<<<<<<<<<<<<
 * 
 *     def get_model_types_platform(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_modelId);
  __pyx_r = __pyx_v_self->_modelId;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5140
 *             return "unknown"
 * 
 *     def get_identifier(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model identifier, name of binary model file and prefix in
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5147
 *         return self._modelId
 * 
 *     def get_model_types_platform(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the set of valid compatible platforms for the Model, extracted
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_137get_model_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_136get_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_137get_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_136get_model_types_platform(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_136get_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":5152
 *         from the XML.
 *         """
 *         return FMIL.fmi2_import_get_types_platform(self._fmu)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(fmi2_import_get_types_platform(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5147
 *         return self._modelId
 * 
 *     def get_model_types_platform(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the set of valid compatible platforms for the Model, extracted
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pxd":152
 *     cdef list           _log
 *     cdef object         _fmu_full_path
 *     cdef public object  _enable_logging             # <<<<<<<<<<<<<<
 *     cdef int _allocated_dll, _allocated_context, _allocated_xml, _allocated_fmu
 *     cdef object         _modelId
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":157
 *     cdef object         _modelName
 *     cdef list           _categories
 *     cdef public list    _save_real_variables_val             # <<<<<<<<<<<<<<
 *     cdef public list    _save_int_variables_val
 *     cdef public list    _save_bool_variables_val
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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(__pyx_v_self->_save_real_variables_val);
  __pyx_r = __pyx_v_self->_save_real_variables_val;
  goto __pyx_L0;

  /* function exit code */
  __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));

  /* function exit code */
  __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
  PyObject *__pyx_t_1 = NULL;
  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 %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_save_real_variables_val);
  __Pyx_DECREF(__pyx_v_self->_save_real_variables_val);
  __pyx_v_self->_save_real_variables_val = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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));

  /* function exit code */
  __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(__pyx_v_self->_save_real_variables_val);
  __pyx_v_self->_save_real_variables_val = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":158
 *     cdef list           _categories
 *     cdef public list    _save_real_variables_val
 *     cdef public list    _save_int_variables_val             # <<<<<<<<<<<<<<
 *     cdef public list    _save_bool_variables_val
 *     cdef object         __t
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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(__pyx_v_self->_save_int_variables_val);
  __pyx_r = __pyx_v_self->_save_int_variables_val;
  goto __pyx_L0;

  /* function exit code */
  __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));

  /* function exit code */
  __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
  PyObject *__pyx_t_1 = NULL;
  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 %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_save_int_variables_val);
  __Pyx_DECREF(__pyx_v_self->_save_int_variables_val);
  __pyx_v_self->_save_int_variables_val = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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));

  /* function exit code */
  __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(__pyx_v_self->_save_int_variables_val);
  __pyx_v_self->_save_int_variables_val = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":159
 *     cdef public list    _save_real_variables_val
 *     cdef public list    _save_int_variables_val
 *     cdef public list    _save_bool_variables_val             # <<<<<<<<<<<<<<
 *     cdef object         __t
 *     cdef public object  _pyEventInfo
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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(__pyx_v_self->_save_bool_variables_val);
  __pyx_r = __pyx_v_self->_save_bool_variables_val;
  goto __pyx_L0;

  /* function exit code */
  __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));

  /* function exit code */
  __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
  PyObject *__pyx_t_1 = NULL;
  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 %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_save_bool_variables_val);
  __Pyx_DECREF(__pyx_v_self->_save_bool_variables_val);
  __pyx_v_self->_save_bool_variables_val = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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));

  /* function exit code */
  __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(__pyx_v_self->_save_bool_variables_val);
  __pyx_v_self->_save_bool_variables_val = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":161
 *     cdef public list    _save_bool_variables_val
 *     cdef object         __t
 *     cdef public object  _pyEventInfo             # <<<<<<<<<<<<<<
 *     cdef char* _fmu_log_name
 *     cdef char* _fmu_temp_dir
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __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));

  /* function exit code */
  __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;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5159
 *     Co-simulation model loaded from a dll
 *     """
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = "", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_11FMUModelCS2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2___init__[] = "\n        Constructor of the model.\n\n        Parameters::\n\n            fmu --\n                Name of the fmu as a string.\n\n            path --\n                Path to the fmu-directory.\n                Default: '.' (working directory)\n\n            enable_logging --\n                Boolean for acesss to logging-messages.\n                Default: True\n\n            log_file_name --\n                Filename for file used to save log messages.\n                Default: \"\" (Generates automatically)\n\n        Returns::\n\n            A model as an object from the class FMUModelCS2\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelCS2___init__;
#endif
static int __pyx_pw_5pyfmi_3fmi_11FMUModelCS2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fmu,&__pyx_n_s_path,&__pyx_n_s_enable_logging,&__pyx_n_s_log_file_name,&__pyx_n_s_log_level,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s__10);
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)__pyx_kp_s__2);
    values[4] = __pyx_k__139;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_level);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5159; __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 = 5159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2___init__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name, __pyx_v_log_level);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_11FMUModelCS2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":5186
 * 
 *         #Call super
 *         FMUModelBase2.__init__(self, fmu, path, enable_logging, log_file_name, log_level)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_cs:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelBase2)), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(6+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __Pyx_INCREF(__pyx_v_log_file_name);
  PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_log_file_name);
  __Pyx_GIVEREF(__pyx_v_log_file_name);
  __Pyx_INCREF(__pyx_v_log_level);
  PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_4, __pyx_v_log_level);
  __Pyx_GIVEREF(__pyx_v_log_level);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5188
 *         FMUModelBase2.__init__(self, fmu, path, enable_logging, log_file_name, log_level)
 * 
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_cs:             # <<<<<<<<<<<<<<
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:
 *                 raise FMUException("This class only supports FMI 2.0 for Co-simulation.")
 */
  __pyx_t_6 = ((__pyx_v_self->__pyx_base._fmu_kind != fmi2_fmu_kind_cs) != 0);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":5189
 * 
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_cs:
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:             # <<<<<<<<<<<<<<
 *                 raise FMUException("This class only supports FMI 2.0 for Co-simulation.")
 * 
 */
    __pyx_t_6 = ((__pyx_v_self->__pyx_base._fmu_kind != fmi2_fmu_kind_me_and_cs) != 0);
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":5190
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_cs:
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:
 *                 raise FMUException("This class only supports FMI 2.0 for Co-simulation.")             # <<<<<<<<<<<<<<
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__140, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_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 = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5192
 *                 raise FMUException("This class only supports FMI 2.0 for Co-simulation.")
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:             # <<<<<<<<<<<<<<
 *             raise FMUException('Models that need an execution tool are not supported')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_capability_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_needsExecutionTool); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, Py_True, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":5193
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 *             raise FMUException('Models that need an execution tool are not supported')             # <<<<<<<<<<<<<<
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__141, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5193; __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 = 5193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5195
 *             raise FMUException('Models that need an execution tool are not supported')
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))             # <<<<<<<<<<<<<<
 *         self.instantiate()
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyBytes_FromString(fmi2_import_get_model_identifier_CS(__pyx_v_self->__pyx_base._fmu)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._modelId);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._modelId);
  __pyx_v_self->__pyx_base._modelId = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5196
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))
 *         self.instantiate()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_instantiate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_7) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5159
 *     Co-simulation model loaded from a dll
 *     """
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = "", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5198
 *         self.instantiate()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_2__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyfmi\fmi.pyx":5202
 *         Deallocate memory allocated
 *         """
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_terminate(self._fmu)
 *             FMIL.fmi2_import_free_instance(self._fmu)
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base._allocated_fmu == 1) != 0);
  if (__pyx_t_1) {

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

    /* "pyfmi\fmi.pyx":5204
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi2_import_terminate(self._fmu)
 *             FMIL.fmi2_import_free_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll == 1:
 */
    fmi2_import_free_instance(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5206
 *             FMIL.fmi2_import_free_instance(self._fmu)
 * 
 *         if self._allocated_dll == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base._allocated_dll == 1) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5207
 * 
 *         if self._allocated_dll == 1:
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_xml == 1:
 */
    fmi2_import_destroy_dllfmu(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5209
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 *         if self._allocated_xml == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free(self._fmu)
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base._allocated_xml == 1) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5210
 * 
 *         if self._allocated_xml == 1:
 *             FMIL.fmi2_import_free(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_temp_dir != NULL:
 */
    fmi2_import_free(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5212
 *             FMIL.fmi2_import_free(self._fmu)
 * 
 *         if self._fmu_temp_dir != NULL:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base._fmu_temp_dir != NULL) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5213
 * 
 *         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":5214
 *         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":5215
 *             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":5217
 *             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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5218
 * 
 *         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":5220
 *             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) != 0);
  if (__pyx_t_1) {

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

  /* "pyfmi\fmi.pyx":5198
 *         self.instantiate()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":5224
 *             self._fmu_log_name = NULL
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current time of the simulation.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelCS2__get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  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_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5_get_time)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_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":5231
 *             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;

  /* "pyfmi\fmi.pyx":5224
 *             self._fmu_log_name = NULL
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current time of the simulation.
 */

  /* function exit code */
  __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.FMUModelCS2._get_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_4_get_time[] = "\n        Returns the current time of the simulation.\n\n        Returns::\n            The time.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_4_get_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_4_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_11FMUModelCS2__get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":5233
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi2_real_t t):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the current time of the simulation.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_7_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelCS2__set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, fmi2_real_t __pyx_v_t, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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("_set_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_7_set_time)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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":5241
 *                 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 = 5241; __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;

  /* "pyfmi\fmi.pyx":5233
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi2_real_t t):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the current time of the simulation.
 */

  /* function exit code */
  __pyx_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_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_7_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_6_set_time[] = "\n        Sets the current time of the simulation. \n\n        Parameters:: \n            t-- \n                The time to set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_7_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t) {
  fmi2_real_t __pyx_v_t;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  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 = 5233; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_6_set_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((fmi2_real_t)__pyx_v_t));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_6_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, fmi2_real_t __pyx_v_t) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_11FMUModelCS2__set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5249
 *     """)
 * 
 *     def do_step(self, FMIL.fmi2_real_t current_t, FMIL.fmi2_real_t step_size, new_step=True):             # <<<<<<<<<<<<<<
 *         """
 *         Performs an integrator step.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_9do_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_8do_step[] = "\n        Performs an integrator step.\n\n        Parameters::\n\n            current_t --\n                The current communication point (current time) of\n                the master.\n\n            step_size --\n                The length of the step to be taken.\n\n            new_step --\n                True the last step was accepted by the master and\n                False if not.\n\n        Returns::\n\n            status --\n                    The status of function which can be checked against\n                    FMI_OK, FMI_WARNING. FMI_DISCARD, FMI_ERROR,\n                    FMI_FATAL,FMI_PENDING...\n\n        Calls the underlying low-level function fmi2DoStep.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_9do_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  fmi2_real_t __pyx_v_current_t;
  fmi2_real_t __pyx_v_step_size;
  PyObject *__pyx_v_new_step = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_step (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_current_t,&__pyx_n_s_step_size,&__pyx_n_s_new_step,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_current_t)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_step_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_step", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5249; __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 = 5249; __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 = 5249; __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 = 5249; __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 = 5249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.do_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_8do_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_current_t, __pyx_v_step_size, __pyx_v_new_step);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_8do_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, fmi2_real_t __pyx_v_current_t, fmi2_real_t __pyx_v_step_size, PyObject *__pyx_v_new_step) {
  int __pyx_v_status;
  fmi2_boolean_t __pyx_v_new_s;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_step", 0);

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

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

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

  /* "pyfmi\fmi.pyx":5283
 *             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 = 5283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5285
 *         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":5287
 *         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 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5249
 *     """)
 * 
 *     def do_step(self, FMIL.fmi2_real_t current_t, FMIL.fmi2_real_t step_size, new_step=True):             # <<<<<<<<<<<<<<
 *         """
 *         Performs an integrator step.
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":5289
 *         return status
 * 
 *     def cancel_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         Cancel a current integrator step. Can only be called if the
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_11cancel_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_10cancel_step[] = "\n        Cancel a current integrator step. Can only be called if the\n        status from do_step returns FMI_PENDING.\n        After this function has been called, only calls to the low-level\n        functions:\n            -fmi2Terminate\n            -fmi2Reset\n            -fmi2FreeInstance\n        are allowed\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_11cancel_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancel_step (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_10cancel_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_10cancel_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cancel_step", 0);

  /* "pyfmi\fmi.pyx":5303
 *         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":5304
 * 
 *         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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5305
 *         status = FMIL.fmi2_import_cancel_step(self._fmu)
 *         if status != 0:
 *             raise FMUException('An error occured while canceling the step')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5305; __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 = 5305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5289
 *         return status
 * 
 *     def cancel_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         Cancel a current integrator step. Can only be called if the
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":5308
 * 
 * 
 *     def set_input_derivatives(self, variables, values, FMIL.fmi2_integer_t order):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the input derivative order for the specified variables.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_13set_input_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_12set_input_derivatives[] = "\n        Sets the input derivative order for the specified variables.\n\n        Parameters::\n\n                variables --\n                        The variables as a string or list of strings for\n                        which the input derivative(s) should be set.\n\n                values --\n                        The actual values.\n\n                order --\n                        The derivative order to set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_13set_input_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variables = 0;
  PyObject *__pyx_v_values = 0;
  fmi2_integer_t __pyx_v_order;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_derivatives (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_variables,&__pyx_n_s_values,&__pyx_n_s_order,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_variables)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_order)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_input_derivatives") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_variables = values[0];
    __pyx_v_values = values[1];
    __pyx_v_order = __Pyx_PyInt_As_fmi2_integer_t(values[2]); if (unlikely((__pyx_v_order == (fmi2_integer_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5308; __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 = 5308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.set_input_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_12set_input_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_variables, __pyx_v_values, __pyx_v_order);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_12set_input_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_values, fmi2_integer_t __pyx_v_order) {
  int __pyx_v_status;
  unsigned int __pyx_v_can_interpolate_inputs;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_orders = 0;
  PyArrayObject *__pyx_v_value_refs = 0;
  PyArrayObject *__pyx_v_val = 0;
  size_t __pyx_v_i;
  PyObject *__pyx_v_v = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_orders;
  __Pyx_Buffer __pyx_pybuffer_orders;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val;
  __Pyx_Buffer __pyx_pybuffer_val;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_value_refs;
  __Pyx_Buffer __pyx_pybuffer_value_refs;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  PyArrayObject *__pyx_t_16 = NULL;
  fmi2_value_reference_t __pyx_t_17;
  long __pyx_t_18;
  int __pyx_t_19;
  PyObject *(*__pyx_t_20)(PyObject *);
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  size_t __pyx_t_24;
  size_t __pyx_t_25;
  size_t __pyx_t_26;
  size_t __pyx_t_27;
  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":5329
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __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_4, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_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 = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__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 = 5329; __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_1);
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":5332
 * 
 *         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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5332; __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_int_0);
      PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
    }
  }
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5332; __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_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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 = 5332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
  {
    __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_9, &__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_11, &__pyx_t_12, &__pyx_t_13);
      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_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_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 = 5332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_orders = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":5334
 *         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":5337
 *         #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_14 = ((__pyx_v_order < 1) != 0);
  if (__pyx_t_14) {

    /* "pyfmi\fmi.pyx":5338
 * 
 *         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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__143, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5338; __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 = 5338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5339
 *         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_14 = ((!(__pyx_v_can_interpolate_inputs != 0)) != 0);
  if (__pyx_t_14) {

    /* "pyfmi\fmi.pyx":5340
 *             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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__144, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5340; __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 = 5340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5342
 *             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_14 = PyString_Check(__pyx_v_variables); 
  __pyx_t_15 = (__pyx_t_14 != 0);
  if (__pyx_t_15) {

    /* "pyfmi\fmi.pyx":5343
 * 
 *         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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_1, 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 = 5343; __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 = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __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_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_flatten); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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 = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((PyArrayObject *)__pyx_t_3);
    {
      __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_16, &__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_13, &__pyx_t_12, &__pyx_t_11);
        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_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_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 = 5343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_16 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":5344
 *         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_17 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_variables, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_18 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_18 >= __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 = 5344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi2_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_L5;
  }

  /* "pyfmi\fmi.pyx":5345
 *             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_14 = PyList_Check(__pyx_v_variables); 
  __pyx_t_19 = (__pyx_t_14 != 0);
  if (__pyx_t_19) {
  } else {
    __pyx_t_15 = __pyx_t_19;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_prod); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) {
    __pyx_t_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
    __pyx_t_20 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_20 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_20)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_20(__pyx_t_4);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_19 = PyString_Check(__pyx_v_v); 
    __pyx_t_21 = __Pyx_PyBool_FromLong(__pyx_t_19); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_21);
    __pyx_t_22 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_22)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_22);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_22) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_21); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_23 = PyTuple_New(1+1); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_23);
      PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_22); __Pyx_GIVEREF(__pyx_t_22); __pyx_t_22 = NULL;
      PyTuple_SET_ITEM(__pyx_t_23, 0+1, __pyx_t_21);
      __Pyx_GIVEREF(__pyx_t_21);
      __pyx_t_21 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_23, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_15 = __pyx_t_19;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_15) {

    /* "pyfmi\fmi.pyx":5346
 *             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_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5346; __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 = 5346; __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 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_flatten); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((PyArrayObject *)__pyx_t_3);
    {
      __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_16, &__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 = 5346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_16 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":5347
 *         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_24 = __pyx_v_nref;
    for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
      __pyx_v_i = __pyx_t_25;

      /* "pyfmi\fmi.pyx":5348
 *             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_3 = __Pyx_GetItemInt(__pyx_v_variables, __pyx_v_i, size_t, 0, __Pyx_PyInt_From_size_t, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5348; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_17 = ((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_3, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_26 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (unlikely(__pyx_t_26 >= (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 = 5348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi2_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_17;

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

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

  /* "pyfmi\fmi.pyx":5353
 *             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,             # <<<<<<<<<<<<<<
 *                                                                 <FMIL.fmi2_integer_t*> orders.data, <FMIL.fmi2_real_t*> val.data)
 * 
 */
  __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":5356
 *                                                                 <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_15 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_15) {

    /* "pyfmi\fmi.pyx":5357
 * 
 *         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_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5357; __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 = 5357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5308
 * 
 * 
 *     def set_input_derivatives(self, variables, values, FMIL.fmi2_integer_t order):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the input derivative order for the specified variables.
 */

  /* function exit code */
  __pyx_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_6);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.set_input_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_orders);
  __Pyx_XDECREF((PyObject *)__pyx_v_value_refs);
  __Pyx_XDECREF((PyObject *)__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_15get_output_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_14get_output_derivatives[] = "\n        Returns the output derivatives for the specified variables. The\n        order specifies the nth-derivative.\n\n        Parameters::\n\n            variables --\n                The variables for which the output derivatives\n                should be returned.\n\n            order --\n                The derivative order.\n\n        Returns::\n\n            The derivatives of the specified order.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_15get_output_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variables = 0;
  fmi2_integer_t __pyx_v_order;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_output_derivatives (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_variables,&__pyx_n_s_order,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_variables)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_order)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_output_derivatives", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5359; __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 = 5359; __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_As_fmi2_integer_t(values[1]); if (unlikely((__pyx_v_order == (fmi2_integer_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5359; __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 = 5359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.get_output_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_14get_output_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_variables, __pyx_v_order);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_14get_output_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_variables, fmi2_integer_t __pyx_v_order) {
  int __pyx_v_status;
  unsigned int __pyx_v_max_output_derivative;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_value_refs = 0;
  PyArrayObject *__pyx_v_orders = 0;
  size_t __pyx_v_i;
  PyObject *__pyx_v_v = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_orders;
  __Pyx_Buffer __pyx_pybuffer_orders;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_value_refs;
  __Pyx_Buffer __pyx_pybuffer_value_refs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  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;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  fmi2_value_reference_t __pyx_t_15;
  long __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  PyObject *(*__pyx_t_19)(PyObject *);
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  size_t __pyx_t_23;
  size_t __pyx_t_24;
  size_t __pyx_t_25;
  size_t __pyx_t_26;
  PyArrayObject *__pyx_t_27 = 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":5385
 * 
 * 
 *         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":5387
 *         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_2 = ((__pyx_v_order < 1) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_order > __pyx_v_max_output_derivative) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5388
 * 
 *         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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_output_derivative); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_The_order_must_be_greater_than_z, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __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 = 5388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5390
 *             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_1 = PyString_Check(__pyx_v_variables); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":5391
 * 
 *         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":5392
 *         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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __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 = 5392; __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_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5392; __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 = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
    {
      __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 = 5392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":5393
 *             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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_fmi2_integer_t(__pyx_v_order); 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_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_8, 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 = 5393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 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 = 5393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__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 = 5393; __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 = 5393; __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":5394
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).flatten()
 *             orders = N.array([order], dtype=N.int32)
 *             value_refs[0] = self.get_variable_valueref(variables)             # <<<<<<<<<<<<<<
 *         elif isinstance(variables,list) and N.prod([int(isinstance(v,str)) for v in variables]): #prod equals 0 or 1
 *             nref = len(variables)
 */
    __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_variables, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi2_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_15;
    goto __pyx_L6;
  }

  /* "pyfmi\fmi.pyx":5395
 *             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_1 = PyList_Check(__pyx_v_variables); 
  __pyx_t_17 = (__pyx_t_1 != 0);
  if (__pyx_t_17) {
  } else {
    __pyx_t_2 = __pyx_t_17;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_prod); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) {
    __pyx_t_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); __pyx_t_18 = 0;
    __pyx_t_19 = NULL;
  } else {
    __pyx_t_18 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_19 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_19)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_18); __Pyx_INCREF(__pyx_t_6); __pyx_t_18++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_18); __Pyx_INCREF(__pyx_t_6); __pyx_t_18++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_19(__pyx_t_4);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_int); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_17 = PyString_Check(__pyx_v_v); 
    __pyx_t_20 = __Pyx_PyBool_FromLong(__pyx_t_17); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __pyx_t_21 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_21)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_21);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_21) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_20); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_22);
      PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = NULL;
      PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_20);
      __Pyx_GIVEREF(__pyx_t_20);
      __pyx_t_20 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_22, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_2 = __pyx_t_17;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_2) {

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

    /* "pyfmi\fmi.pyx":5397
 *         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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
      }
    }
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_flatten); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_7);
    {
      __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 = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":5398
 *             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_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __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_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 = 5398; __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":5399
 *             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_23 = __pyx_v_nref;
    for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
      __pyx_v_i = __pyx_t_24;

      /* "pyfmi\fmi.pyx":5400
 *             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, size_t, 0, __Pyx_PyInt_From_size_t, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5400; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_t_6, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_25 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (unlikely(__pyx_t_25 >= (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 = 5400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi2_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_15;

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

    /* "pyfmi\fmi.pyx":5403
 *                 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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 5403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":5405
 *             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_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyList_New(1 * (__pyx_v_nref)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __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_float_0_0);
      PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_float_0_0);
      __Pyx_GIVEREF(__pyx_float_0_0);
    }
  }
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_27 = ((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_27, &__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 = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_27 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pyfmi\fmi.pyx":5407
 *         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,             # <<<<<<<<<<<<<<
 *                                                             <FMIL.fmi2_integer_t*> orders.data, <FMIL.fmi2_real_t*> values.data)
 * 
 */
  __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":5410
 *                                                             <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) != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":5411
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__148, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.get_output_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_value_refs);
  __Pyx_XDECREF((PyObject *)__pyx_v_orders);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5416
 * 
 * 
 *     def get_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the fmi-status for the the specified fmi-staus-kind.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_17get_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_16get_status[] = "\n        Retrieves the fmi-status for the the specified fmi-staus-kind.\n\n        Parameters::\n\n            status_kind --\n                An integer corresponding to one of the following:\n                fmi2DoStepStatus       = 0\n                fmi2PendingStatus      = 1\n                fmi2LastSuccessfulTime = 2\n                fmi2Terminated         = 3\n\n        Returns::\n\n            status_ok      = 0\n            status_warning = 1\n            status_discard = 2\n            status_error   = 3\n            status_fatal   = 4\n            status_pending = 5\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_17get_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_16get_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_16get_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  int __pyx_v_status;
  int __pyx_v_fmi_status_kind;
  int __pyx_v_status_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_status", 0);

  /* "pyfmi\fmi.pyx":5443
 *         cdef int status_value
 * 
 *         if status_kind >= 0 and status_kind <= 3:             # <<<<<<<<<<<<<<
 *             fmi_status_kind = status_kind
 *         else:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5444
 * 
 *         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_4 = __Pyx_PyInt_As_int(__pyx_v_status_kind); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_4;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5446
 *             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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__149, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5446; __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 = 5446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5448
 *             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":5449
 * 
 *         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_1 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5450
 *         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_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__150, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5450; __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 = 5450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5452
 *             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_2 = __Pyx_PyInt_From_int(__pyx_v_status_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5416
 * 
 * 
 *     def get_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the fmi-status for the the specified fmi-staus-kind.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __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;
}

/* "pyfmi\fmi.pyx":5454
 *         return status_value
 * 
 *     def get_real_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a real-value,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_19get_real_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_18get_real_status[] = "\n        Retrieves the status, represented as a real-value,\n        for the specified fmi-status-kind.\n        See docstring for function get_status() for more\n        information about fmi-status-kind.\n\n        Parameters::\n\n            status_kind--\n                integer indicating the status kind\n\n        Returns::\n\n            The status.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_19get_real_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_real_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_18get_real_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_18get_real_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  int __pyx_v_status;
  int __pyx_v_fmi_status_kind;
  fmi2_real_t __pyx_v_output;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_real_status", 0);

  /* "pyfmi\fmi.pyx":5475
 *         cdef FMIL.fmi2_real_t output
 * 
 *         if status_kind >= 0 and status_kind <= 3:             # <<<<<<<<<<<<<<
 *             fmi_status_kind = status_kind
 *         else:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5476
 * 
 *         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_4 = __Pyx_PyInt_As_int(__pyx_v_status_kind); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_4;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5478
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); 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_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__151, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5478; __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 = 5478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5481
 * 
 * 
 *         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":5482
 * 
 *         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_1 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5483
 *         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_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__152, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5483; __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 = 5483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5485
 *             raise FMUException('An error occured while retriving the status')
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     def get_integer_status(self, status_kind):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5454
 *         return status_value
 * 
 *     def get_real_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a real-value,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __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;
}

/* "pyfmi\fmi.pyx":5487
 *         return output
 * 
 *     def get_integer_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a integer-value,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_21get_integer_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_20get_integer_status[] = "\n        Retrieves the status, represented as a integer-value,\n        for the specified fmi-status-kind.\n        See docstring for function get_status() for more\n        information about fmi-status-kind.\n\n        Parameters::\n\n            status_kind--\n                integer indicating the status kind\n\n        Returns::\n\n            The status.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_21get_integer_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_integer_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_20get_integer_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_20get_integer_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  int __pyx_v_status;
  int __pyx_v_fmi_status_kind;
  fmi2_integer_t __pyx_v_output;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_integer_status", 0);

  /* "pyfmi\fmi.pyx":5508
 *         cdef FMIL.fmi2_integer_t output
 * 
 *         if status_kind >= 0 and status_kind <= 3:             # <<<<<<<<<<<<<<
 *             fmi_status_kind = status_kind
 *         else:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5509
 * 
 *         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_4 = __Pyx_PyInt_As_int(__pyx_v_status_kind); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_4;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5511
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__153, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5511; __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 = 5511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5514
 * 
 * 
 *         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":5515
 * 
 *         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_1 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5516
 *         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_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__154, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5516; __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 = 5516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5518
 *             raise FMUException('An error occured while retriving the status')
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     def get_boolean_status(self, status_kind):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_fmi2_integer_t(__pyx_v_output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5487
 *         return output
 * 
 *     def get_integer_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a integer-value,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __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;
}

/* "pyfmi\fmi.pyx":5520
 *         return output
 * 
 *     def get_boolean_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a boolean-value,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_23get_boolean_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_22get_boolean_status[] = "\n        Retrieves the status, represented as a boolean-value,\n        for the specified fmi-status-kind.\n        See docstring for function get_status() for more\n        information about fmi-status-kind.\n\n        Parameters::\n\n            status_kind--\n                integer indicating the status kind\n\n        Returns::\n\n            The status.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_23get_boolean_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_boolean_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_22get_boolean_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_22get_boolean_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  int __pyx_v_status;
  int __pyx_v_fmi_status_kind;
  fmi2_boolean_t __pyx_v_output;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_boolean_status", 0);

  /* "pyfmi\fmi.pyx":5541
 *         cdef FMIL.fmi2_boolean_t output
 * 
 *         if status_kind >= 0 and status_kind <= 3:             # <<<<<<<<<<<<<<
 *             fmi_status_kind = status_kind
 *         else:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5542
 * 
 *         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_4 = __Pyx_PyInt_As_int(__pyx_v_status_kind); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_4;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5544
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__155, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5544; __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 = 5544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5547
 * 
 * 
 *         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":5548
 * 
 *         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_1 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5549
 *         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_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__156, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5549; __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 = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5551
 *             raise FMUException('An error occured while retriving the status')
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     def get_string_status(self, status_kind):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_fmi2_boolean_t(__pyx_v_output); 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_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5520
 *         return output
 * 
 *     def get_boolean_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a boolean-value,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __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;
}

/* "pyfmi\fmi.pyx":5553
 *         return output
 * 
 *     def get_string_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a string-value,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_25get_string_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_24get_string_status[] = "\n        Retrieves the status, represented as a string-value,\n        for the specified fmi-status-kind.\n        See docstring for function get_status() for more\n        information about fmi-status-kind.\n\n        Parameters::\n\n            status_kind--\n                integer indicating the status kind\n\n        Returns::\n\n            The status.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_25get_string_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_string_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_24get_string_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_24get_string_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  int __pyx_v_status;
  int __pyx_v_fmi_status_kind;
  fmi2_string_t __pyx_v_output;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_string_status", 0);

  /* "pyfmi\fmi.pyx":5574
 *         cdef FMIL.fmi2_string_t output
 * 
 *         if status_kind >= 0 and status_kind <= 3:             # <<<<<<<<<<<<<<
 *             fmi_status_kind = status_kind
 *         else:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5575
 * 
 *         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_4 = __Pyx_PyInt_As_int(__pyx_v_status_kind); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_4;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5577
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__157, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5577; __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 = 5577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5580
 * 
 * 
 *         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":5581
 * 
 *         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_1 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5582
 *         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_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__158, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5582; __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 = 5582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5584
 *             raise FMUException('An error occured while retriving the status')
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5553
 *         return output
 * 
 *     def get_string_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a string-value,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __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;
}

/* "pyfmi\fmi.pyx":5587
 * 
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time="Default",
 *                  final_time="Default",
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_27simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_26simulate[] = "\n        Compact function for model simulation.\n\n        The simulation method depends on which algorithm is used, this can be\n        set with the function argument 'algorithm'. Options for the algorithm\n        are passed as option classes or as pure dicts. See\n        FMUModel.simulate_options for more details.\n\n        The default algorithm for this function is FMICSAlg.\n\n        Parameters::\n\n            start_time --\n                Start time for the simulation.\n                Default: Start time defined in the default experiment from\n                        the ModelDescription file.\n\n            final_time --\n                Final time for the simulation.\n                Default: Stop time defined in the default experiment from\n                        the ModelDescription file.\n\n            input --\n                Input signal for the simulation. The input should be a 2-tuple\n                consisting of first the names of the input variable(s) and then\n                the data matrix.\n                Default: Empty tuple.\n\n            algorithm --\n                The algorithm which will be used for the simulation is specified\n                by passing the algorithm class as string or class object in this\n                argument. 'algorithm' can be any class which implements the\n                abstract class AlgorithmBase (found in algorithm_drivers.py). In\n                this way it is possible to write own algorithms and use them\n                with this function.\n                Default: 'FMICSAlg'\n\n            options --\n                The options that should be used in the algorithm. For details on\n                the options do:\n\n                    >> myModel = FMUModel(...)\n                    >> opts = myModel.simulate_options()\n                    >> opts?\n\n                Valid values are:\n                    - A dict which gives AssimuloFMIAlgOptions with\n                      default valu""es on all options except the ones\n                      listed in the dict. Empty dict will thus give all\n                      options with default values.\n                    - An options object.\n                Default: Empty dict\n\n        Returns::\n\n            Result object, subclass of common.algorithm_drivers.ResultBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_27simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_final_time = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start_time,&__pyx_n_s_final_time,&__pyx_n_s_input,&__pyx_n_s_algorithm,&__pyx_n_s_options,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_n_s_Default);
    values[1] = ((PyObject *)__pyx_n_s_Default);

    /* "pyfmi\fmi.pyx":5590
 *                  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__159;
    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 = 5587; __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 = 5587; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_26simulate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_start_time, __pyx_v_final_time, __pyx_v_input, __pyx_v_algorithm, __pyx_v_options);

  /* "pyfmi\fmi.pyx":5587
 * 
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time="Default",
 *                  final_time="Default",
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_26simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = 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":5650
 *             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, __pyx_n_s_Default, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5651
 *         """
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()             # <<<<<<<<<<<<<<
 *         if final_time == "Default":
 *             final_time = self.get_default_experiment_stop_time()
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_start_tim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_start_time, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

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

    /* "pyfmi\fmi.pyx":5653
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_stop_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_final_time, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

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

  /* "pyfmi\fmi.pyx":5660
 *                                              'pyfmi.fmi_algorithm_drivers',
 *                                              algorithm,
 *                                              options)             # <<<<<<<<<<<<<<
 * 
 *     def simulate_options(self, algorithm='FMICSAlg'):
 */
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(6+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_start_time);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start_time);
  __Pyx_GIVEREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_final_time);
  __Pyx_GIVEREF(__pyx_v_final_time);
  __Pyx_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_input);
  __Pyx_GIVEREF(__pyx_v_input);
  __Pyx_INCREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_GIVEREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_5, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_5, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5587
 * 
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time="Default",
 *                  final_time="Default",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start_time);
  __Pyx_XDECREF(__pyx_v_final_time);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_29simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_28simulate_options[] = "\n        Get an instance of the simulate options class, filled with default\n        values. If called without argument then the options class for the\n        default simulation algorithm will be returned.\n\n        Parameters::\n\n            algorithm --\n                The algorithm for which the options class should be fetched.\n                Possible values are: 'FMICSAlg'.\n                Default: 'FMICSAlg'\n\n        Returns::\n\n            Options class for the algorithm specified with default values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_29simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_algorithm,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s_FMICSAlg);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_algorithm);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5662; __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 = 5662; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_28simulate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_algorithm);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_28simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_algorithm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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("simulate_options", 0);

  /* "pyfmi\fmi.pyx":5679
 *             Options class for the algorithm specified with default values.
 *         """
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)             # <<<<<<<<<<<<<<
 * 
 *     def get_capability_flags(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default_options); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_GIVEREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5679; __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5681
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def get_capability_flags(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the capability flags of the FMU.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_31get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_30get_capability_flags[] = "\n        Returns a dictionary with the capability flags of the FMU.\n\n        Returns::\n            Dictionary with keys:\n            needsExecutionTool\n            canHandleVariableCommunicationStepSize\n            canInterpolateInputs\n            maxOutputDerivativeOrder\n            canRunAsynchronuously\n            canBeInstantiatedOnlyOncePerProcess\n            canNotUseMemoryManagementFunctions\n            canGetAndSetFMUstate\n            providesDirectionalDerivatives\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_31get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_capability_flags (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_30get_capability_flags(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_30get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self) {
  PyObject *__pyx_v_capabilities = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_capability_flags", 0);

  /* "pyfmi\fmi.pyx":5697
 *             providesDirectionalDerivatives
 *         """
 *         cdef dict capabilities = {}             # <<<<<<<<<<<<<<
 *         capabilities['needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))
 *         capabilities['canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_capabilities = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5698
 *         """
 *         cdef dict capabilities = {}
 *         capabilities['needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))             # <<<<<<<<<<<<<<
 *         capabilities['canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))
 *         capabilities['canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_needsExecutionTool)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __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 = 5698; __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 = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_needsExecutionTool, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5699
 *         cdef dict capabilities = {}
 *         capabilities['needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))
 *         capabilities['canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))             # <<<<<<<<<<<<<<
 *         capabilities['canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))
 *         capabilities['maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canHandleVariableCommunicationStepSize)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5699; __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 = 5699; __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 = 5699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canHandleVariableCommunicationSt, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5700
 *         capabilities['needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))
 *         capabilities['canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))
 *         capabilities['canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))             # <<<<<<<<<<<<<<
 *         capabilities['maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 *         capabilities['canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canInterpolateInputs)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5700; __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 = 5700; __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 = 5700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canInterpolateInputs, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5701
 *         capabilities['canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))
 *         capabilities['canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))
 *         capabilities['maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)             # <<<<<<<<<<<<<<
 *         capabilities['canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))
 *         capabilities['canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_maxOutputDerivativeOrder)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_maxOutputDerivativeOrder, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5702
 *         capabilities['canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))
 *         capabilities['maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 *         capabilities['canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))             # <<<<<<<<<<<<<<
 *         capabilities['canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canRunAsynchronuously)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5702; __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 = 5702; __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 = 5702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canRunAsynchronuously, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5703
 *         capabilities['maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 *         capabilities['canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))
 *         capabilities['canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))             # <<<<<<<<<<<<<<
 *         capabilities['canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))
 *         capabilities['canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canBeInstantiatedOnlyOncePerProcess)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5703; __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 = 5703; __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 = 5703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canBeInstantiatedOnlyOncePerProc, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5704
 *         capabilities['canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))
 *         capabilities['canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))             # <<<<<<<<<<<<<<
 *         capabilities['canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))
 *         capabilities['canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSerializeFMUstate))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canNotUseMemoryManagementFunctions)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5704; __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 = 5704; __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 = 5704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canNotUseMemoryManagementFunctio, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5705
 *         capabilities['canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))
 *         capabilities['canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))             # <<<<<<<<<<<<<<
 *         capabilities['canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSerializeFMUstate))
 *         capabilities['providesDirectionalDerivatives']         = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_providesDirectionalDerivatives))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canGetAndSetFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5705; __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 = 5705; __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 = 5705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canGetAndSetFMUstate, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5706
 *         capabilities['canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))
 *         capabilities['canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))
 *         capabilities['canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSerializeFMUstate))             # <<<<<<<<<<<<<<
 *         capabilities['providesDirectionalDerivatives']         = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_providesDirectionalDerivatives))
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canSerializeFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5706; __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 = 5706; __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 = 5706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canSerializeFMUstate, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5707
 *         capabilities['canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))
 *         capabilities['canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSerializeFMUstate))
 *         capabilities['providesDirectionalDerivatives']         = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_providesDirectionalDerivatives))             # <<<<<<<<<<<<<<
 * 
 *         return capabilities
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_providesDirectionalDerivatives)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5707; __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 = 5707; __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 = 5707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_providesDirectionalDerivatives, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5709
 *         capabilities['providesDirectionalDerivatives']         = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_providesDirectionalDerivatives))
 * 
 *         return capabilities             # <<<<<<<<<<<<<<
 * 
 *     def _provides_directional_derivatives(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_capabilities);
  __pyx_r = __pyx_v_capabilities;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5681
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def get_capability_flags(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the capability flags of the FMU.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.get_capability_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_capabilities);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5711
 *         return capabilities
 * 
 *     def _provides_directional_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check capability to provide directional derivatives.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_33_provides_directional_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_32_provides_directional_derivatives[] = "\n        Check capability to provide directional derivatives.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_33_provides_directional_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_provides_directional_derivatives (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_32_provides_directional_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_32_provides_directional_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_provides_directional_derivatives", 0);

  /* "pyfmi\fmi.pyx":5715
 *         Check capability to provide directional derivatives.
 *         """
 *         return FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_providesDirectionalDerivatives)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_providesDirectionalDerivatives)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5711
 *         return capabilities
 * 
 *     def _provides_directional_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check capability to provide directional derivatives.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2._provides_directional_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5723
 *     """
 * 
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = "", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2___init__[] = "\n        Constructor of the model.\n\n        Parameters::\n\n            fmu --\n                Name of the fmu as a string.\n\n            path --\n                Path to the fmu-directory.\n                Default: '.' (working directory)\n\n            enable_logging --\n                Boolean for acesss to logging-messages.\n                Default: True\n\n            log_file_name --\n                Filename for file used to save logmessages.\n                Default: \"\" (Generates automatically)\n\n        Returns::\n\n            A model as an object from the class FMUModelME2\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelME2___init__;
#endif
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fmu,&__pyx_n_s_path,&__pyx_n_s_enable_logging,&__pyx_n_s_log_file_name,&__pyx_n_s_log_level,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s__10);
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)__pyx_kp_s__2);
    values[4] = __pyx_k__160;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_level);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5723; __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 = 5723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2___init__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name, __pyx_v_log_level);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_11FMUModelME2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  fmi2_boolean_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":5749
 *         """
 *         #Call super
 *         FMUModelBase2.__init__(self, fmu, path, enable_logging, log_file_name, log_level)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_me:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelBase2)), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(6+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __Pyx_INCREF(__pyx_v_log_file_name);
  PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_log_file_name);
  __Pyx_GIVEREF(__pyx_v_log_file_name);
  __Pyx_INCREF(__pyx_v_log_level);
  PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_4, __pyx_v_log_level);
  __Pyx_GIVEREF(__pyx_v_log_level);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5749; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5751
 *         FMUModelBase2.__init__(self, fmu, path, enable_logging, log_file_name, log_level)
 * 
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_me:             # <<<<<<<<<<<<<<
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:
 *                 raise FMUException('This class only supports FMI 2.0 for Model Exchange.')
 */
  __pyx_t_6 = ((__pyx_v_self->__pyx_base._fmu_kind != fmi2_fmu_kind_me) != 0);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":5752
 * 
 *         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_6 = ((__pyx_v_self->__pyx_base._fmu_kind != fmi2_fmu_kind_me_and_cs) != 0);
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":5753
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_me:
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:
 *                 raise FMUException('This class only supports FMI 2.0 for Model Exchange.')             # <<<<<<<<<<<<<<
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__161, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5753; __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 = 5753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5755
 *                 raise FMUException('This class only supports FMI 2.0 for Model Exchange.')
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:             # <<<<<<<<<<<<<<
 *             raise FMUException('Models that need an execution tool are not supported')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_capability_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5755; __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_GetItem(__pyx_t_2, __pyx_n_s_needsExecutionTool); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5755; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, Py_True, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":5756
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 *             raise FMUException('Models that need an execution tool are not supported')             # <<<<<<<<<<<<<<
 * 
 *         self._eventInfo.newDiscreteStatesNeeded           = FMI2_FALSE
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__162, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5756; __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 = 5756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5758
 *             raise FMUException('Models that need an execution tool are not supported')
 * 
 *         self._eventInfo.newDiscreteStatesNeeded           = FMI2_FALSE             # <<<<<<<<<<<<<<
 *         self._eventInfo.terminateSimulation               = FMI2_FALSE
 *         self._eventInfo.nominalsOfContinuousStatesChanged = FMI2_FALSE
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_FALSE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_As_fmi2_boolean_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->__pyx_base._eventInfo.newDiscreteStatesNeeded = __pyx_t_7;

  /* "pyfmi\fmi.pyx":5759
 * 
 *         self._eventInfo.newDiscreteStatesNeeded           = FMI2_FALSE
 *         self._eventInfo.terminateSimulation               = FMI2_FALSE             # <<<<<<<<<<<<<<
 *         self._eventInfo.nominalsOfContinuousStatesChanged = FMI2_FALSE
 *         self._eventInfo.valuesOfContinuousStatesChanged   = FMI2_TRUE
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_FALSE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_As_fmi2_boolean_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->__pyx_base._eventInfo.terminateSimulation = __pyx_t_7;

  /* "pyfmi\fmi.pyx":5760
 *         self._eventInfo.newDiscreteStatesNeeded           = FMI2_FALSE
 *         self._eventInfo.terminateSimulation               = FMI2_FALSE
 *         self._eventInfo.nominalsOfContinuousStatesChanged = FMI2_FALSE             # <<<<<<<<<<<<<<
 *         self._eventInfo.valuesOfContinuousStatesChanged   = FMI2_TRUE
 *         self._eventInfo.nextEventTimeDefined              = FMI2_FALSE
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_FALSE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_As_fmi2_boolean_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->__pyx_base._eventInfo.nominalsOfContinuousStatesChanged = __pyx_t_7;

  /* "pyfmi\fmi.pyx":5761
 *         self._eventInfo.terminateSimulation               = FMI2_FALSE
 *         self._eventInfo.nominalsOfContinuousStatesChanged = FMI2_FALSE
 *         self._eventInfo.valuesOfContinuousStatesChanged   = FMI2_TRUE             # <<<<<<<<<<<<<<
 *         self._eventInfo.nextEventTimeDefined              = FMI2_FALSE
 *         self._eventInfo.nextEventTime                     = 0.0
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_TRUE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_As_fmi2_boolean_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->__pyx_base._eventInfo.valuesOfContinuousStatesChanged = __pyx_t_7;

  /* "pyfmi\fmi.pyx":5762
 *         self._eventInfo.nominalsOfContinuousStatesChanged = FMI2_FALSE
 *         self._eventInfo.valuesOfContinuousStatesChanged   = FMI2_TRUE
 *         self._eventInfo.nextEventTimeDefined              = FMI2_FALSE             # <<<<<<<<<<<<<<
 *         self._eventInfo.nextEventTime                     = 0.0
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_FALSE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_As_fmi2_boolean_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->__pyx_base._eventInfo.nextEventTimeDefined = __pyx_t_7;

  /* "pyfmi\fmi.pyx":5763
 *         self._eventInfo.valuesOfContinuousStatesChanged   = FMI2_TRUE
 *         self._eventInfo.nextEventTimeDefined              = FMI2_FALSE
 *         self._eventInfo.nextEventTime                     = 0.0             # <<<<<<<<<<<<<<
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_ME(self._fmu))
 */
  __pyx_v_self->__pyx_base._eventInfo.nextEventTime = 0.0;

  /* "pyfmi\fmi.pyx":5765
 *         self._eventInfo.nextEventTime                     = 0.0
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_ME(self._fmu))             # <<<<<<<<<<<<<<
 *         self.instantiate()
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyBytes_FromString(fmi2_import_get_model_identifier_ME(__pyx_v_self->__pyx_base._fmu)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._modelId);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._modelId);
  __pyx_v_self->__pyx_base._modelId = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5766
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_ME(self._fmu))
 *         self.instantiate()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_instantiate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_8) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5766; __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":5723
 *     """
 * 
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = "", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5768
 *         self.instantiate()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

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

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_5pyfmi_3fmi_11FMUModelME2_2__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyfmi\fmi.pyx":5773
 *         """
 * 
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_terminate(self._fmu)
 *             FMIL.fmi2_import_free_instance(self._fmu)
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base._allocated_fmu == 1) != 0);
  if (__pyx_t_1) {

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

    /* "pyfmi\fmi.pyx":5775
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi2_import_terminate(self._fmu)
 *             FMIL.fmi2_import_free_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll == 1:
 */
    fmi2_import_free_instance(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5777
 *             FMIL.fmi2_import_free_instance(self._fmu)
 * 
 *         if self._allocated_dll == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base._allocated_dll == 1) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5778
 * 
 *         if self._allocated_dll == 1:
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_xml == 1:
 */
    fmi2_import_destroy_dllfmu(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5780
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 *         if self._allocated_xml == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free(self._fmu)
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base._allocated_xml == 1) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5781
 * 
 *         if self._allocated_xml == 1:
 *             FMIL.fmi2_import_free(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_temp_dir != NULL:
 */
    fmi2_import_free(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5783
 *             FMIL.fmi2_import_free(self._fmu)
 * 
 *         if self._fmu_temp_dir != NULL:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base._fmu_temp_dir != NULL) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5784
 * 
 *         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":5785
 *         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":5786
 *             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":5788
 *             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) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5789
 * 
 *         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":5791
 *             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) != 0);
  if (__pyx_t_1) {

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

  /* "pyfmi\fmi.pyx":5768
 *         self.instantiate()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":5795
 *             self._fmu_log_name = NULL
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current time of the simulation.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME2__get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  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_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5_get_time)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__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":5802
 *             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;

  /* "pyfmi\fmi.pyx":5795
 *             self._fmu_log_name = NULL
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current time of the simulation.
 */

  /* function exit code */
  __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.FMUModelME2._get_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_4_get_time[] = "\n        Returns the current time of the simulation.\n\n        Returns::\n            The time.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_4_get_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_4_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_11FMUModelME2__get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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":5804
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi2_real_t t):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the current time of the simulation.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_7_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME2__set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, fmi2_real_t __pyx_v_t, int __pyx_skip_dispatch) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_7_set_time)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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":5814
 * 
 *         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":5816
 *         status = FMIL.fmi2_import_set_time(self._fmu, t)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the time.')
 *         self.__t = t
 */
  __pyx_t_7 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":5817
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 *         self.__t = t
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__163, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5817; __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 = 5817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":5804
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi2_real_t t):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the current time of the simulation.
 */

  /* function exit code */
  __pyx_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_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_7_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_6_set_time[] = "\n        Sets the current time of the simulation.\n\n        Parameters::\n            t--\n                The time to set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_7_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t) {
  fmi2_real_t __pyx_v_t;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  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 = 5804; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_6_set_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), ((fmi2_real_t)__pyx_v_t));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_6_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, fmi2_real_t __pyx_v_t) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_11FMUModelME2__set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":5826
 *     """)
 * 
 *     def get_event_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event information from the FMU.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_9get_event_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_8get_event_info[] = "\n        Returns the event information from the FMU.\n\n        Returns::\n\n            The event information, a struct which contains:\n\n            newDiscreteStatesNeeded --\n                Event iteration did not converge (if True).\n\n            terminateSimulation --\n                Error, terminate simulation (if True).\n\n            nominalsOfContinuousStatesChanged --\n                Values of states x have changed (if True).\n\n            valuesOfContinuousStatesChanged --\n                ValueReferences of states x changed (if True).\n\n            nextEventTimeDefined -\n                If True, nextEventTime is the next time event.\n\n            nextEventTime --\n                The next time event.\n\n        Example::\n\n            event_info    = model.event_info\n            nextEventTime = model.event_info.nextEventTime\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_9get_event_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_event_info (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_8get_event_info(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_8get_event_info(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_event_info", 0);

  /* "pyfmi\fmi.pyx":5857
 *             nextEventTime = model.event_info.nextEventTime
 *         """
 *         self._pyEventInfo.newDiscreteStatesNeeded           = self._eventInfo.newDiscreteStatesNeeded == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.terminateSimulation               = self._eventInfo.terminateSimulation == 1
 *         self._pyEventInfo.nominalsOfContinuousStatesChanged = self._eventInfo.nominalsOfContinuousStatesChanged == 1
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.newDiscreteStatesNeeded == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_newDiscreteStatesNeeded, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5858
 *         """
 *         self._pyEventInfo.newDiscreteStatesNeeded           = self._eventInfo.newDiscreteStatesNeeded == 1
 *         self._pyEventInfo.terminateSimulation               = self._eventInfo.terminateSimulation == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.nominalsOfContinuousStatesChanged = self._eventInfo.nominalsOfContinuousStatesChanged == 1
 *         self._pyEventInfo.valuesOfContinuousStatesChanged   = self._eventInfo.valuesOfContinuousStatesChanged == 1
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.terminateSimulation == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_terminateSimulation, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5859
 *         self._pyEventInfo.newDiscreteStatesNeeded           = self._eventInfo.newDiscreteStatesNeeded == 1
 *         self._pyEventInfo.terminateSimulation               = self._eventInfo.terminateSimulation == 1
 *         self._pyEventInfo.nominalsOfContinuousStatesChanged = self._eventInfo.nominalsOfContinuousStatesChanged == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.valuesOfContinuousStatesChanged   = self._eventInfo.valuesOfContinuousStatesChanged == 1
 *         self._pyEventInfo.nextEventTimeDefined              = self._eventInfo.nextEventTimeDefined == 1
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.nominalsOfContinuousStatesChanged == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_nominalsOfContinuousStatesChange, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5860
 *         self._pyEventInfo.terminateSimulation               = self._eventInfo.terminateSimulation == 1
 *         self._pyEventInfo.nominalsOfContinuousStatesChanged = self._eventInfo.nominalsOfContinuousStatesChanged == 1
 *         self._pyEventInfo.valuesOfContinuousStatesChanged   = self._eventInfo.valuesOfContinuousStatesChanged == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.nextEventTimeDefined              = self._eventInfo.nextEventTimeDefined == 1
 *         self._pyEventInfo.nextEventTime                     = self._eventInfo.nextEventTime
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.valuesOfContinuousStatesChanged == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_valuesOfContinuousStatesChanged, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5861
 *         self._pyEventInfo.nominalsOfContinuousStatesChanged = self._eventInfo.nominalsOfContinuousStatesChanged == 1
 *         self._pyEventInfo.valuesOfContinuousStatesChanged   = self._eventInfo.valuesOfContinuousStatesChanged == 1
 *         self._pyEventInfo.nextEventTimeDefined              = self._eventInfo.nextEventTimeDefined == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.nextEventTime                     = self._eventInfo.nextEventTime
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.nextEventTimeDefined == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_nextEventTimeDefined, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5862
 *         self._pyEventInfo.valuesOfContinuousStatesChanged   = self._eventInfo.valuesOfContinuousStatesChanged == 1
 *         self._pyEventInfo.nextEventTimeDefined              = self._eventInfo.nextEventTimeDefined == 1
 *         self._pyEventInfo.nextEventTime                     = self._eventInfo.nextEventTime             # <<<<<<<<<<<<<<
 * 
 *         return self._pyEventInfo
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._eventInfo.nextEventTime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_nextEventTime, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5864
 *         self._pyEventInfo.nextEventTime                     = self._eventInfo.nextEventTime
 * 
 *         return self._pyEventInfo             # <<<<<<<<<<<<<<
 * 
 *     def enter_event_mode(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__pyx_base._pyEventInfo);
  __pyx_r = __pyx_v_self->__pyx_base._pyEventInfo;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5826
 *     """)
 * 
 *     def get_event_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event information from the FMU.
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":5866
 *         return self._pyEventInfo
 * 
 *     def enter_event_mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the FMU to be in event mode by calling the
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_11enter_event_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_10enter_event_mode[] = "\n        Sets the FMU to be in event mode by calling the\n        underlying FMU method.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_11enter_event_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enter_event_mode (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_10enter_event_mode(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_10enter_event_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enter_event_mode", 0);

  /* "pyfmi\fmi.pyx":5872
 *         """
 *         cdef int status
 *         status = FMIL.fmi2_import_enter_event_mode(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_enter_event_mode(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":5874
 *         status = FMIL.fmi2_import_enter_event_mode(self._fmu)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to enter event mode.')
 * 
 */
  __pyx_t_1 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5875
 * 
 *         if status != 0:
 *             raise FMUException('Failed to enter event mode.')             # <<<<<<<<<<<<<<
 * 
 *     def enter_continuous_time_mode(self):
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__164, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5875; __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 = 5875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5866
 *         return self._pyEventInfo
 * 
 *     def enter_event_mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the FMU to be in event mode by calling the
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.enter_event_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5877
 *             raise FMUException('Failed to enter event mode.')
 * 
 *     def enter_continuous_time_mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the FMU to be in continuous time mode by calling the
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_13enter_continuous_time_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_12enter_continuous_time_mode[] = "\n        Sets the FMU to be in continuous time mode by calling the\n        underlying FMU method.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_13enter_continuous_time_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enter_continuous_time_mode (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_12enter_continuous_time_mode(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_12enter_continuous_time_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enter_continuous_time_mode", 0);

  /* "pyfmi\fmi.pyx":5883
 *         """
 *         cdef int status
 *         status = FMIL.fmi2_import_enter_continuous_time_mode(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_enter_continuous_time_mode(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":5885
 *         status = FMIL.fmi2_import_enter_continuous_time_mode(self._fmu)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to enter continuous time mode.')
 * 
 */
  __pyx_t_1 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5886
 * 
 *         if status != 0:
 *             raise FMUException('Failed to enter continuous time mode.')             # <<<<<<<<<<<<<<
 * 
 *     def get_event_indicators(self):
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__165, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5886; __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 = 5886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":5877
 *             raise FMUException('Failed to enter event mode.')
 * 
 *     def enter_continuous_time_mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the FMU to be in continuous time mode by calling the
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.enter_continuous_time_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5888
 *             raise FMUException('Failed to enter continuous time mode.')
 * 
 *     def get_event_indicators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event indicators at the current time-point.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_15get_event_indicators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_14get_event_indicators[] = "\n        Returns the event indicators at the current time-point.\n\n        Returns::\n\n            evInd --\n                The event indicators as an array.\n\n        Example::\n\n            evInd = model.get_event_indicators()\n\n        Calls the low-level FMI function: fmiGetEventIndicators\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_15get_event_indicators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_event_indicators (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_14get_event_indicators(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_14get_event_indicators(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_values = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_event_indicators", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;

  /* "pyfmi\fmi.pyx":5904
 *         """
 *         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_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5904; __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_From_size_t(__pyx_v_self->__pyx_base._nEventIndicators); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5904; __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 = 5904; __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 = 5904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5904; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5904; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 5904; __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 = 5904; __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":5906
 *         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":5908
 *         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) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":5909
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__166, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5909; __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 = 5909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":5888
 *             raise FMUException('Failed to enter continuous time mode.')
 * 
 *     def get_event_indicators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event indicators at the current time-point.
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":5913
 *         return values
 * 
 *     def event_update(self, intermediateResult=False):             # <<<<<<<<<<<<<<
 *         """
 *         Updates the event information at the current time-point. If
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_17event_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_16event_update[] = "\n        Updates the event information at the current time-point. If\n        intermediateResult is set to True the update_event will stop at each\n        event iteration which would require to loop until\n        event_info.newDiscreteStatesNeeded == fmiFalse.\n\n        Parameters::\n\n            intermediateResult --\n                If set to True, the update_event will stop at each event\n                iteration.\n                Default: False.\n\n        Example::\n\n            model.event_update()\n\n        Calls the low-level FMI function: fmi2NewDiscreteStates\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_17event_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_intermediateResult = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("event_update (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_intermediateResult,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    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 = 5913; __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 = 5913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.event_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_16event_update(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_intermediateResult);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_16event_update(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_intermediateResult) {
  int __pyx_v_status;
  int __pyx_v_tmpValuesOfContinuousStatesChanged;
  int __pyx_v_tmpNominalsOfContinuousStatesChanged;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  fmi2_boolean_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("event_update", 0);

  /* "pyfmi\fmi.pyx":5935
 *         cdef int status
 * 
 *         if intermediateResult:             # <<<<<<<<<<<<<<
 *             status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)
 *             if status != 0:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_intermediateResult); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5936
 * 
 *         if intermediateResult:
 *             status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)             # <<<<<<<<<<<<<<
 *             if status != 0:
 *                 raise FMUException('Failed to update the events at time: %E.'%self.time)
 */
    __pyx_v_status = fmi2_import_new_discrete_states(__pyx_v_self->__pyx_base._fmu, (&__pyx_v_self->__pyx_base._eventInfo));

    /* "pyfmi\fmi.pyx":5937
 *         if intermediateResult:
 *             status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)
 *             if status != 0:             # <<<<<<<<<<<<<<
 *                 raise FMUException('Failed to update the events at time: %E.'%self.time)
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_status != 0) != 0);
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":5938
 *             status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)
 *             if status != 0:
 *                 raise FMUException('Failed to update the events at time: %E.'%self.time)             # <<<<<<<<<<<<<<
 *         else:
 *             tmpValuesOfContinuousStatesChanged = False
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_update_the_events_at_t, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __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 = 5938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L3;
  }
  /*else*/ {

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

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

    /* "pyfmi\fmi.pyx":5943
 *             tmpNominalsOfContinuousStatesChanged = False
 * 
 *             self._eventInfo.newDiscreteStatesNeeded = FMI2_TRUE             # <<<<<<<<<<<<<<
 *             while self._eventInfo.newDiscreteStatesNeeded:
 *                 status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_TRUE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyInt_As_fmi2_boolean_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->__pyx_base._eventInfo.newDiscreteStatesNeeded = __pyx_t_7;

    /* "pyfmi\fmi.pyx":5944
 * 
 *             self._eventInfo.newDiscreteStatesNeeded = FMI2_TRUE
 *             while self._eventInfo.newDiscreteStatesNeeded:             # <<<<<<<<<<<<<<
 *                 status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)
 * 
 */
    while (1) {
      __pyx_t_1 = (__pyx_v_self->__pyx_base._eventInfo.newDiscreteStatesNeeded != 0);
      if (!__pyx_t_1) break;

      /* "pyfmi\fmi.pyx":5945
 *             self._eventInfo.newDiscreteStatesNeeded = FMI2_TRUE
 *             while self._eventInfo.newDiscreteStatesNeeded:
 *                 status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)             # <<<<<<<<<<<<<<
 * 
 *                 if self._eventInfo.nominalsOfContinuousStatesChanged:
 */
      __pyx_v_status = fmi2_import_new_discrete_states(__pyx_v_self->__pyx_base._fmu, (&__pyx_v_self->__pyx_base._eventInfo));

      /* "pyfmi\fmi.pyx":5947
 *                 status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)
 * 
 *                 if self._eventInfo.nominalsOfContinuousStatesChanged:             # <<<<<<<<<<<<<<
 *                     tmpNominalsOfContinuousStatesChanged = True
 *                 if self._eventInfo.valuesOfContinuousStatesChanged:
 */
      __pyx_t_1 = (__pyx_v_self->__pyx_base._eventInfo.nominalsOfContinuousStatesChanged != 0);
      if (__pyx_t_1) {

        /* "pyfmi\fmi.pyx":5948
 * 
 *                 if self._eventInfo.nominalsOfContinuousStatesChanged:
 *                     tmpNominalsOfContinuousStatesChanged = True             # <<<<<<<<<<<<<<
 *                 if self._eventInfo.valuesOfContinuousStatesChanged:
 *                     tmpValuesOfContinuousStatesChanged = True
 */
        __pyx_v_tmpNominalsOfContinuousStatesChanged = 1;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "pyfmi\fmi.pyx":5949
 *                 if self._eventInfo.nominalsOfContinuousStatesChanged:
 *                     tmpNominalsOfContinuousStatesChanged = True
 *                 if self._eventInfo.valuesOfContinuousStatesChanged:             # <<<<<<<<<<<<<<
 *                     tmpValuesOfContinuousStatesChanged = True
 *                 if status != 0:
 */
      __pyx_t_1 = (__pyx_v_self->__pyx_base._eventInfo.valuesOfContinuousStatesChanged != 0);
      if (__pyx_t_1) {

        /* "pyfmi\fmi.pyx":5950
 *                     tmpNominalsOfContinuousStatesChanged = True
 *                 if self._eventInfo.valuesOfContinuousStatesChanged:
 *                     tmpValuesOfContinuousStatesChanged = True             # <<<<<<<<<<<<<<
 *                 if status != 0:
 *                     raise FMUException('Failed to update the events at time: %E.'%self.time)
 */
        __pyx_v_tmpValuesOfContinuousStatesChanged = 1;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "pyfmi\fmi.pyx":5951
 *                 if self._eventInfo.valuesOfContinuousStatesChanged:
 *                     tmpValuesOfContinuousStatesChanged = True
 *                 if status != 0:             # <<<<<<<<<<<<<<
 *                     raise FMUException('Failed to update the events at time: %E.'%self.time)
 * 
 */
      __pyx_t_1 = ((__pyx_v_status != 0) != 0);
      if (__pyx_t_1) {

        /* "pyfmi\fmi.pyx":5952
 *                     tmpValuesOfContinuousStatesChanged = True
 *                 if status != 0:
 *                     raise FMUException('Failed to update the events at time: %E.'%self.time)             # <<<<<<<<<<<<<<
 * 
 *             # If the values in the event struct have been overwritten.
 */
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_update_the_events_at_t, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5952; __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 = NULL;
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5952; __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_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }

    /* "pyfmi\fmi.pyx":5955
 * 
 *             # If the values in the event struct have been overwritten.
 *             if tmpNominalsOfContinuousStatesChanged:             # <<<<<<<<<<<<<<
 *                 self._eventInfo.nominalsOfContinuousStatesChanged = True
 *             if tmpValuesOfContinuousStatesChanged:
 */
    __pyx_t_1 = (__pyx_v_tmpNominalsOfContinuousStatesChanged != 0);
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":5956
 *             # If the values in the event struct have been overwritten.
 *             if tmpNominalsOfContinuousStatesChanged:
 *                 self._eventInfo.nominalsOfContinuousStatesChanged = True             # <<<<<<<<<<<<<<
 *             if tmpValuesOfContinuousStatesChanged:
 *                 self._eventInfo.valuesOfContinuousStatesChanged = True
 */
      __pyx_v_self->__pyx_base._eventInfo.nominalsOfContinuousStatesChanged = 1;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "pyfmi\fmi.pyx":5957
 *             if tmpNominalsOfContinuousStatesChanged:
 *                 self._eventInfo.nominalsOfContinuousStatesChanged = True
 *             if tmpValuesOfContinuousStatesChanged:             # <<<<<<<<<<<<<<
 *                 self._eventInfo.valuesOfContinuousStatesChanged = True
 * 
 */
    __pyx_t_1 = (__pyx_v_tmpValuesOfContinuousStatesChanged != 0);
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":5958
 *                 self._eventInfo.nominalsOfContinuousStatesChanged = True
 *             if tmpValuesOfContinuousStatesChanged:
 *                 self._eventInfo.valuesOfContinuousStatesChanged = True             # <<<<<<<<<<<<<<
 * 
 *     def get_tolerances(self):
 */
      __pyx_v_self->__pyx_base._eventInfo.valuesOfContinuousStatesChanged = 1;
      goto __pyx_L11;
    }
    __pyx_L11:;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5913
 *         return values
 * 
 *     def event_update(self, intermediateResult=False):             # <<<<<<<<<<<<<<
 *         """
 *         Updates the event information at the current time-point. If
 */

  /* function exit code */
  __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_XDECREF(__pyx_t_6);
  __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;
}

/* "pyfmi\fmi.pyx":5960
 *                 self._eventInfo.valuesOfContinuousStatesChanged = True
 * 
 *     def get_tolerances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the relative and absolute tolerances. If the relative tolerance
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_19get_tolerances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_18get_tolerances[] = "\n        Returns the relative and absolute tolerances. If the relative tolerance\n        is defined in the XML-file it is used, otherwise a default of 1.e-4 is\n        used. The absolute tolerance is calculated and returned according to\n        the FMI specification, atol = 0.01*rtol*(nominal values of the\n        continuous states).\n\n        Returns::\n\n            rtol --\n                The relative tolerance.\n\n            atol --\n                The absolute tolerance.\n\n        Example::\n\n            [rtol, atol] = model.get_tolerances()\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_19get_tolerances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_tolerances (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_18get_tolerances(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_18get_tolerances(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  PyObject *__pyx_v_rtol = NULL;
  PyObject *__pyx_v_atol = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_tolerances", 0);

  /* "pyfmi\fmi.pyx":5981
 *         """
 * 
 *         rtol = self.get_default_experiment_tolerance()             # <<<<<<<<<<<<<<
 *         atol = 0.01*rtol*self.nominal_continuous_states
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_tolerance); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_rtol = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5982
 * 
 *         rtol = self.get_default_experiment_tolerance()
 *         atol = 0.01*rtol*self.nominal_continuous_states             # <<<<<<<<<<<<<<
 * 
 *         return [rtol, atol]
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_float_0_01, __pyx_v_rtol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nominal_continuous_states); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5982; __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 = 5982; __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":5984
 *         atol = 0.01*rtol*self.nominal_continuous_states
 * 
 *         return [rtol, atol]             # <<<<<<<<<<<<<<
 * 
 *     def completed_integrator_step(self, no_set_FMU_state_prior_to_current_point = True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5984; __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 = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5960
 *                 self._eventInfo.valuesOfContinuousStatesChanged = True
 * 
 *     def get_tolerances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the relative and absolute tolerances. If the relative tolerance
 */

  /* function exit code */
  __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":5986
 *         return [rtol, atol]
 * 
 *     def completed_integrator_step(self, no_set_FMU_state_prior_to_current_point = True):             # <<<<<<<<<<<<<<
 *         """
 *         This method must be called by the environment after every completed step
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_21completed_integrator_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_20completed_integrator_step[] = "\n        This method must be called by the environment after every completed step\n        of the integrator. If the return is True, then the environment must call\n        event_update() otherwise, no action is needed.\n\n        Returns::\n\n            True -> Call event_update().\n            False -> Do nothing.\n\n        Calls the low-level FMI function: fmi2CompletedIntegratorStep.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_21completed_integrator_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_no_set_FMU_state_prior_to_current_point = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("completed_integrator_step (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_no_set_FMU_state_prior_to_curren,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_True);
    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_no_set_FMU_state_prior_to_curren);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "completed_integrator_step") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_no_set_FMU_state_prior_to_current_point = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("completed_integrator_step", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.completed_integrator_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_20completed_integrator_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_no_set_FMU_state_prior_to_current_point);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_20completed_integrator_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_no_set_FMU_state_prior_to_current_point) {
  int __pyx_v_status;
  fmi2_boolean_t __pyx_v_noSetFMUStatePriorToCurrentPoint;
  fmi2_boolean_t __pyx_v_enterEventMode;
  fmi2_boolean_t __pyx_v_terminateSimulation;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_boolean_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  fmi2_boolean_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("completed_integrator_step", 0);

  /* "pyfmi\fmi.pyx":6000
 *         """
 *         cdef int status
 *         cdef FMIL.fmi2_boolean_t noSetFMUStatePriorToCurrentPoint = FMI2_TRUE if no_set_FMU_state_prior_to_current_point else FMI2_FALSE             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi2_boolean_t enterEventMode
 *         cdef FMIL.fmi2_boolean_t terminateSimulation
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_no_set_FMU_state_prior_to_current_point); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_TRUE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_As_fmi2_boolean_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_FALSE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_As_fmi2_boolean_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_v_noSetFMUStatePriorToCurrentPoint = __pyx_t_1;

  /* "pyfmi\fmi.pyx":6004
 *         cdef FMIL.fmi2_boolean_t terminateSimulation
 * 
 *         status = FMIL.fmi2_import_completed_integrator_step(self._fmu, noSetFMUStatePriorToCurrentPoint, &enterEventMode, &terminateSimulation)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_completed_integrator_step(__pyx_v_self->__pyx_base._fmu, __pyx_v_noSetFMUStatePriorToCurrentPoint, (&__pyx_v_enterEventMode), (&__pyx_v_terminateSimulation));

  /* "pyfmi\fmi.pyx":6006
 *         status = FMIL.fmi2_import_completed_integrator_step(self._fmu, noSetFMUStatePriorToCurrentPoint, &enterEventMode, &terminateSimulation)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to call FMI Completed Step.')
 * 
 */
  __pyx_t_2 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":6007
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         return enterEventMode==FMI2_TRUE, terminateSimulation==FMI2_TRUE
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__167, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6007; __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 = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":6009
 *             raise FMUException('Failed to call FMI Completed Step.')
 * 
 *         return enterEventMode==FMI2_TRUE, terminateSimulation==FMI2_TRUE             # <<<<<<<<<<<<<<
 * 
 *     def _get_continuous_states(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyInt_From_fmi2_boolean_t(__pyx_v_enterEventMode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_TRUE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_fmi2_boolean_t(__pyx_v_terminateSimulation); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI2_TRUE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6009; __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);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":5986
 *         return [rtol, atol]
 * 
 *     def completed_integrator_step(self, no_set_FMU_state_prior_to_current_point = True):             # <<<<<<<<<<<<<<
 *         """
 *         This method must be called by the environment after every completed step
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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;
}

/* "pyfmi\fmi.pyx":6011
 *         return enterEventMode==FMI2_TRUE, terminateSimulation==FMI2_TRUE
 * 
 *     def _get_continuous_states(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a vector with the values of the continuous states.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_23_get_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_22_get_continuous_states[] = "\n        Returns a vector with the values of the continuous states.\n\n        Returns::\n\n            The continuous states.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_23_get_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_continuous_states (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_22_get_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_22_get_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_ndx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ndx;
  __Pyx_Buffer __pyx_pybuffer_ndx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_continuous_states", 0);
  __pyx_pybuffer_ndx.pybuffer.buf = NULL;
  __pyx_pybuffer_ndx.refcount = 0;
  __pyx_pybuffernd_ndx.data = NULL;
  __pyx_pybuffernd_ndx.rcbuffer = &__pyx_pybuffer_ndx;

  /* "pyfmi\fmi.pyx":6020
 *         """
 *         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_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6020; __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_From_size_t(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6020; __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 = 6020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6020; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6020; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 6020; __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 = 6020; __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":6021
 *         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":6023
 *         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) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":6024
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__168, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6024; __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 = 6024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":6011
 *         return enterEventMode==FMI2_TRUE, terminateSimulation==FMI2_TRUE
 * 
 *     def _get_continuous_states(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a vector with the values of the continuous states.
 */

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":6028
 *         return ndx
 * 
 *     def _set_continuous_states(self, N.ndarray[FMIL.fmi2_real_t] values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of the continuous states.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_25_set_continuous_states(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_24_set_continuous_states[] = "\n        Set the values of the continuous states.\n\n        Parameters::\n\n            values--\n                The new values of the continuous states.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_25_set_continuous_states(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  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 = 6028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_24_set_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_24_set_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyArrayObject *__pyx_v_values) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_ndx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ndx;
  __Pyx_Buffer __pyx_pybuffer_ndx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_continuous_states", 0);
  __pyx_pybuffer_ndx.pybuffer.buf = NULL;
  __pyx_pybuffer_ndx.refcount = 0;
  __pyx_pybuffernd_ndx.data = NULL;
  __pyx_pybuffernd_ndx.rcbuffer = &__pyx_pybuffer_ndx;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6028; __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":6038
 *         """
 *         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 = 6038; __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":6040
 *         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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ndx), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_size_t(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":6046
 *                 '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":6048
 *         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) != 0);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":6028
 *         return ndx
 * 
 *     def _set_continuous_states(self, N.ndarray[FMIL.fmi2_real_t] values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of the continuous states.
 */

  /* function exit code */
  __pyx_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;
}

/* "pyfmi\fmi.pyx":6058
 *     """)
 * 
 *     def _get_nominal_continuous_states(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the nominal values of the continuous states.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_27_get_nominal_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_26_get_nominal_continuous_states[] = "\n        Returns the nominal values of the continuous states.\n\n        Returns::\n            The nominal values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_27_get_nominal_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_nominal_continuous_states (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_26_get_nominal_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_26_get_nominal_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_ndx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ndx;
  __Pyx_Buffer __pyx_pybuffer_ndx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_nominal_continuous_states", 0);
  __pyx_pybuffer_ndx.pybuffer.buf = NULL;
  __pyx_pybuffer_ndx.refcount = 0;
  __pyx_pybuffernd_ndx.data = NULL;
  __pyx_pybuffernd_ndx.rcbuffer = &__pyx_pybuffer_ndx;

  /* "pyfmi\fmi.pyx":6066
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] ndx = N.zeros(self._nContinuousStates, dtype=N.double)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_nominals_of_continuous_states(
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_size_t(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6066; __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 = 6066; __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 = 6066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6066; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6066; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 6066; __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 = 6066; __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":6068
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] ndx = N.zeros(self._nContinuousStates, dtype=N.double)
 * 
 *         status = FMIL.fmi2_import_get_nominals_of_continuous_states(             # <<<<<<<<<<<<<<
 *                 self._fmu, <FMIL.fmi2_real_t*> ndx.data, self._nContinuousStates)
 * 
 */
  __pyx_v_status = fmi2_import_get_nominals_of_continuous_states(__pyx_v_self->__pyx_base._fmu, ((fmi2_real_t *)__pyx_v_ndx->data), __pyx_v_self->__pyx_base._nContinuousStates);

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

    /* "pyfmi\fmi.pyx":6072
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__171, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6072; __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 = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

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

  /* "pyfmi\fmi.pyx":6058
 *     """)
 * 
 *     def _get_nominal_continuous_states(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the nominal values of the continuous states.
 */

  /* function exit code */
  __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":6082
 *     """)
 * 
 *     cpdef get_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the derivative of the continuous states.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_29get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME2_get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_values = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_derivatives", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_derivatives); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_29get_derivatives)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__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":6098
 *         """
 *         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_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6098; __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_From_size_t(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6098; __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 = 6098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6098; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6098; __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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__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 = 6098; __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 = 6098; __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":6100
 *         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":6102
 *         status = FMIL.fmi2_import_get_derivatives(self._fmu, <FMIL.fmi2_real_t*> values.data, self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the derivative values at time: %E.'%self.time)
 * 
 */
  __pyx_t_7 = ((__pyx_v_status != 0) != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":6103
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the derivative values at time: %E.'%self.time)             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_get_the_derivative_val, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6103; __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_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":6105
 *             raise FMUException('Failed to get the derivative values at time: %E.'%self.time)
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":6082
 *     """)
 * 
 *     cpdef get_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the derivative of the continuous states.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.get_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_29get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_28get_derivatives[] = "\n        Returns the derivative of the continuous states.\n\n        Returns::\n\n            dx --\n                The derivatives as an array.\n\n        Example::\n\n            dx = model.get_derivatives()\n\n        Calls the low-level FMI function: fmi2GetDerivatives\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_29get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_derivatives (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_28get_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_28get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_derivatives", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5pyfmi_3fmi_11FMUModelME2_get_derivatives(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __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;
}

/* "pyfmi\fmi.pyx":6108
 * 
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time="Default",
 *                  final_time="Default",
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_31simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_30simulate[] = "\n        Compact function for model simulation.\n\n        The simulation method depends on which algorithm is used, this can be\n        set with the function argument 'algorithm'. Options for the algorithm\n        are passed as option classes or as pure dicts. See\n        FMUModel.simulate_options for more details.\n\n        The default algorithm for this function is AssimuloFMIAlg.\n\n        Parameters::\n\n            start_time --\n                Start time for the simulation.\n                Default: Start time defined in the default experiment from\n                        the ModelDescription file.\n\n            final_time --\n                Final time for the simulation.\n                Default: Stop time defined in the default experiment from\n                        the ModelDescription file.\n\n            input --\n                Input signal for the simulation. The input should be a 2-tuple\n                consisting of first the names of the input variable(s) and then\n                the data matrix or a function. If a data matrix, the first\n                column should be a time vector and then the variable vectors as\n                columns. If instead a function, the argument should correspond\n                to time and the output the variable data. See the users-guide\n                for examples.\n                Default: Empty tuple.\n\n            algorithm --\n                The algorithm which will be used for the simulation is specified\n                by passing the algorithm class as string or class object in this\n                argument. 'algorithm' can be any class which implements the\n                abstract class AlgorithmBase (found in algorithm_drivers.py). In\n                this way it is possible to write own algorithms and use them\n                with this function.\n                Default: 'AssimuloFMIAlg'\n\n            options --\n                The options that should be used in the algorithm. Fo""r details on\n                the options do:\n\n                    >> myModel = FMUModel(...)\n                    >> opts = myModel.simulate_options()\n                    >> opts?\n\n                Valid values are:\n                    - A dict which gives AssimuloFMIAlgOptions with\n                      default values on all options except the ones\n                      listed in the dict. Empty dict will thus give all\n                      options with default values.\n                    - An options object.\n                Default: Empty dict\n\n        Returns::\n\n            Result object, subclass of common.algorithm_drivers.ResultBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_31simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_final_time = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start_time,&__pyx_n_s_final_time,&__pyx_n_s_input,&__pyx_n_s_algorithm,&__pyx_n_s_options,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_n_s_Default);
    values[1] = ((PyObject *)__pyx_n_s_Default);

    /* "pyfmi\fmi.pyx":6111
 *                  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__172;
    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 = 6108; __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 = 6108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_30simulate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_start_time, __pyx_v_final_time, __pyx_v_input, __pyx_v_algorithm, __pyx_v_options);

  /* "pyfmi\fmi.pyx":6108
 * 
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time="Default",
 *                  final_time="Default",
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_30simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = 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":6175
 *             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, __pyx_n_s_Default, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":6176
 *         """
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()             # <<<<<<<<<<<<<<
 *         if final_time == "Default":
 *             final_time = self.get_default_experiment_stop_time()
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_start_tim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_start_time, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

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

    /* "pyfmi\fmi.pyx":6178
 *             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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_default_experiment_stop_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_final_time, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

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

  /* "pyfmi\fmi.pyx":6185
 *                                              'pyfmi.fmi_algorithm_drivers',
 *                                              algorithm,
 *                                              options)             # <<<<<<<<<<<<<<
 * 
 *     def simulate_options(self, algorithm='AssimuloFMIAlg'):
 */
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(6+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_start_time);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start_time);
  __Pyx_GIVEREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_final_time);
  __Pyx_GIVEREF(__pyx_v_final_time);
  __Pyx_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_input);
  __Pyx_GIVEREF(__pyx_v_input);
  __Pyx_INCREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_GIVEREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_5, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_5, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":6108
 * 
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time="Default",
 *                  final_time="Default",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start_time);
  __Pyx_XDECREF(__pyx_v_final_time);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_33simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_32simulate_options[] = "\n        Get an instance of the simulate options class, filled with default\n        values. If called without argument then the options class for the\n        default simulation algorithm will be returned.\n\n        Parameters::\n\n            algorithm --\n                The algorithm for which the options class should be fetched.\n                Possible values are: 'AssimuloFMIAlg'.\n                Default: 'AssimuloFMIAlg'\n\n        Returns::\n\n            Options class for the algorithm specified with default values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_33simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_algorithm,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s_AssimuloFMIAlg);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_algorithm);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6187; __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 = 6187; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_32simulate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_algorithm);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_32simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_algorithm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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("simulate_options", 0);

  /* "pyfmi\fmi.pyx":6204
 *             Options class for the algorithm specified with default values.
 *         """
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)             # <<<<<<<<<<<<<<
 * 
 *     def get_capability_flags(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default_options); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_GIVEREF(__pyx_kp_s_pyfmi_fmi_algorithm_drivers);
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6204; __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6206
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def get_capability_flags(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the capability flags of the FMU.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_35get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_34get_capability_flags[] = "\n        Returns a dictionary with the capability flags of the FMU.\n\n        Returns::\n            Dictionary with keys:\n            needsExecutionTool\n            completedIntegratorStepNotNeeded\n            canBeInstantiatedOnlyOncePerProcess\n            canNotUseMemoryManagementFunctions\n            canGetAndSetFMUstate\n            canSerializeFMUstate\n            providesDirectionalDerivatives\n            completedEventIterationIsProvided\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_35get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_capability_flags (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_34get_capability_flags(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_34get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  PyObject *__pyx_v_capabilities = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_capability_flags", 0);

  /* "pyfmi\fmi.pyx":6221
 *             completedEventIterationIsProvided
 *         """
 *         cdef dict capabilities = {}             # <<<<<<<<<<<<<<
 *         capabilities['needsExecutionTool']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_needsExecutionTool))
 *         capabilities['completedIntegratorStepNotNeeded']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_capabilities = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6222
 *         """
 *         cdef dict capabilities = {}
 *         capabilities['needsExecutionTool']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_needsExecutionTool))             # <<<<<<<<<<<<<<
 *         capabilities['completedIntegratorStepNotNeeded']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))
 *         capabilities['canBeInstantiatedOnlyOncePerProcess'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_needsExecutionTool)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6222; __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 = 6222; __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 = 6222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_needsExecutionTool, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6223
 *         cdef dict capabilities = {}
 *         capabilities['needsExecutionTool']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_needsExecutionTool))
 *         capabilities['completedIntegratorStepNotNeeded']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))             # <<<<<<<<<<<<<<
 *         capabilities['canBeInstantiatedOnlyOncePerProcess'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['canNotUseMemoryManagementFunctions']  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_completedIntegratorStepNotNeeded)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6223; __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 = 6223; __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 = 6223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_completedIntegratorStepNotNeeded, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6224
 *         capabilities['needsExecutionTool']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_needsExecutionTool))
 *         capabilities['completedIntegratorStepNotNeeded']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))
 *         capabilities['canBeInstantiatedOnlyOncePerProcess'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))             # <<<<<<<<<<<<<<
 *         capabilities['canNotUseMemoryManagementFunctions']  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))
 *         capabilities['canGetAndSetFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_canBeInstantiatedOnlyOncePerProcess)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6224; __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 = 6224; __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 = 6224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canBeInstantiatedOnlyOncePerProc, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6225
 *         capabilities['completedIntegratorStepNotNeeded']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))
 *         capabilities['canBeInstantiatedOnlyOncePerProcess'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['canNotUseMemoryManagementFunctions']  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))             # <<<<<<<<<<<<<<
 *         capabilities['canGetAndSetFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))
 *         capabilities['canSerializeFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_canNotUseMemoryManagementFunctions)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6225; __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 = 6225; __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 = 6225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canNotUseMemoryManagementFunctio, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6226
 *         capabilities['canBeInstantiatedOnlyOncePerProcess'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['canNotUseMemoryManagementFunctions']  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))
 *         capabilities['canGetAndSetFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))             # <<<<<<<<<<<<<<
 *         capabilities['canSerializeFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))
 *         capabilities['providesDirectionalDerivatives']      = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_canGetAndSetFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6226; __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 = 6226; __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 = 6226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canGetAndSetFMUstate, __pyx_t_1) < 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;

  /* "pyfmi\fmi.pyx":6227
 *         capabilities['canNotUseMemoryManagementFunctions']  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))
 *         capabilities['canGetAndSetFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))
 *         capabilities['canSerializeFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))             # <<<<<<<<<<<<<<
 *         capabilities['providesDirectionalDerivatives']      = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives))
 *         capabilities['completedEventIterationIsProvided']   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedEventIterationIsProvided))
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_canSerializeFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6227; __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 = 6227; __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 = 6227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_canSerializeFMUstate, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6228
 *         capabilities['canGetAndSetFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))
 *         capabilities['canSerializeFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))
 *         capabilities['providesDirectionalDerivatives']      = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives))             # <<<<<<<<<<<<<<
 *         capabilities['completedEventIterationIsProvided']   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedEventIterationIsProvided))
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_providesDirectionalDerivatives)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6228; __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 = 6228; __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 = 6228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_providesDirectionalDerivatives, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6229
 *         capabilities['canSerializeFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))
 *         capabilities['providesDirectionalDerivatives']      = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives))
 *         capabilities['completedEventIterationIsProvided']   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedEventIterationIsProvided))             # <<<<<<<<<<<<<<
 * 
 *         return capabilities
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_completedEventIterationIsProvided)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6229; __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 = 6229; __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 = 6229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_capabilities, __pyx_n_s_completedEventIterationIsProvide, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6231
 *         capabilities['completedEventIterationIsProvided']   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedEventIterationIsProvided))
 * 
 *         return capabilities             # <<<<<<<<<<<<<<
 * 
 *     def _provides_directional_derivatives(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_capabilities);
  __pyx_r = __pyx_v_capabilities;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":6206
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def get_capability_flags(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the capability flags of the FMU.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.get_capability_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_capabilities);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6233
 *         return capabilities
 * 
 *     def _provides_directional_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check capability to provide directional derivatives.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_37_provides_directional_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_36_provides_directional_derivatives[] = "\n        Check capability to provide directional derivatives.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_37_provides_directional_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_provides_directional_derivatives (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_36_provides_directional_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_36_provides_directional_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_provides_directional_derivatives", 0);

  /* "pyfmi\fmi.pyx":6237
 *         Check capability to provide directional derivatives.
 *         """
 *         return FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives)             # <<<<<<<<<<<<<<
 * 
 * #Temporary should be removed! (after a period)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_providesDirectionalDerivatives)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyfmi\fmi.pyx":6233
 *         return capabilities
 * 
 *     def _provides_directional_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check capability to provide directional derivatives.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._provides_directional_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_8FMUModel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_8FMUModel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fmu,&__pyx_n_s_path,&__pyx_n_s_enable_logging,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s__10);
    values[2] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6241; __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 = 6241; __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);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  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("__init__", 0);

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

  /* "pyfmi\fmi.pyx":6243
 *     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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME1)), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6243; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9load_fmu_deprecated(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_8load_fmu_deprecated[] = "\n    Helper function for loading FMUs of different kinds.\n    ";
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_9load_fmu_deprecated = {"load_fmu_deprecated", (PyCFunction)__pyx_pw_5pyfmi_3fmi_9load_fmu_deprecated, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_8load_fmu_deprecated};
static PyObject *__pyx_pw_5pyfmi_3fmi_9load_fmu_deprecated(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_fmu_deprecated (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fmu,&__pyx_n_s_path,&__pyx_n_s_enable_logging,&__pyx_n_s_log_file_name,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s__10);
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)__pyx_kp_s__2);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_fmu_deprecated") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6245; __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 = 6245; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.load_fmu_deprecated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_8load_fmu_deprecated(__pyx_self, __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_8load_fmu_deprecated(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name) {
  fmi1_callback_functions_t __pyx_v_callBackFunctions;
  struct jm_callbacks __pyx_v_callbacks;
  fmi_import_context_t *__pyx_v_context;
  fmi1_import_t *__pyx_v__fmu;
  jm_string __pyx_v_last_error;
  int __pyx_v_allocated_context;
  int __pyx_v_allocated_xml;
  PyObject *__pyx_v_fmu_temp_dir = NULL;
  PyObject *__pyx_v_fmu_full_path = NULL;
  fmi_version_enu_t __pyx_v_version;
  enum fmi1_fmu_kind_enu_t __pyx_v_fmu_kind;
  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;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  jm_log_level_enu_t __pyx_t_10;
  char *__pyx_t_11;
  char *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("load_fmu_deprecated", 0);

  /* "pyfmi\fmi.pyx":6261
 * 
 *     #Used for deallocation
 *     allocated_context = False             # <<<<<<<<<<<<<<
 *     allocated_xml = False
 *     fmu_temp_dir = None
 */
  __pyx_v_allocated_context = 0;

  /* "pyfmi\fmi.pyx":6262
 *     #Used for deallocation
 *     allocated_context = False
 *     allocated_xml = False             # <<<<<<<<<<<<<<
 *     fmu_temp_dir = None
 * 
 */
  __pyx_v_allocated_xml = 0;

  /* "pyfmi\fmi.pyx":6263
 *     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":6265
 *     fmu_temp_dir = None
 * 
 *     fmu_full_path = os.path.abspath(os.path.join(path,fmu))             # <<<<<<<<<<<<<<
 *     fmu_temp_dir  = create_temp_dir()
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_abspath); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_fmu_full_path = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6266
 * 
 *     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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_create_temp_dir); 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_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_7) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_fmu_temp_dir, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6269
 * 
 *     # 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmu_full_path, __pyx_n_s_endswith); 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_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__173, 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_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = ((!__pyx_t_8) != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":6270
 *     # 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_2 = __Pyx_GetModuleGlobalName(__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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__174, 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;}
  }

  /* "pyfmi\fmi.pyx":6273
 * 
 *     #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":6274
 *     #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":6275
 *     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":6276
 *     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":6277
 *     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":6278
 *     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_9 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_9) {
    __pyx_t_10 = jm_log_level_warning;
  } else {
    __pyx_t_10 = jm_log_level_nothing;
  }
  __pyx_v_callbacks.log_level = __pyx_t_10;

  /* "pyfmi\fmi.pyx":6282
 * 
 *     #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":6283
 *     #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":6284
 *     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":6286
 *     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":6287
 * 
 *     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":6290
 * 
 *     #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_11 = __Pyx_PyObject_AsString(__pyx_v_fmu_full_path); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_version = fmi_import_get_fmi_version(__pyx_v_context, __pyx_t_11, __pyx_t_12);

  /* "pyfmi\fmi.pyx":6292
 *     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_9 = ((__pyx_v_version == fmi_version_unknown_enu) != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":6293
 * 
 *     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":6296
 * 
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    __pyx_t_9 = (__pyx_v_allocated_context != 0);
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":6297
 *         #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":6299
 *             FMIL.fmi_import_free_context(context)
 * 
 *         if enable_logging:             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU version could not be determined. "+last_error)
 *         else:
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":6300
 * 
 *         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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = PyNumber_Add(__pyx_kp_s_The_FMU_version_could_not_be_det, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __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 = 6300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6302
 *             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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__175, 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_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 = 6302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

  /* "pyfmi\fmi.pyx":6303
 *         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_9 = ((__pyx_v_version != 1) != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":6305
 *     if version != 1:
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    __pyx_t_9 = (__pyx_v_allocated_context != 0);
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":6306
 *         #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":6308
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Parse the XML
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__176, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6308; __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 = 6308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":6311
 * 
 *     #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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__fmu = fmi1_import_parse_xml(__pyx_v_context, __pyx_t_12);

  /* "pyfmi\fmi.pyx":6312
 *     #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_9 = ((__pyx_v__fmu == NULL) != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":6313
 *     _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":6314
 *     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_9 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":6315
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyNumber_Add(__pyx_kp_s_The_XML_file_could_not_be_parsed, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_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 = 6315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6317
 *             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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__177, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6317; __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 = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

  /* "pyfmi\fmi.pyx":6318
 *         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":6321
 * 
 *     #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_v_fmu_kind = fmi1_import_get_fmu_kind(__pyx_v__fmu);

  /* "pyfmi\fmi.pyx":6322
 *     #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_2 = PyInt_FromLong(__pyx_v_fmu_kind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_ME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":6323
 *     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_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_fmu);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_fmu);
    __Pyx_GIVEREF(__pyx_v_fmu);
    __Pyx_INCREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    __Pyx_INCREF(__pyx_v_enable_logging);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_enable_logging);
    __Pyx_GIVEREF(__pyx_v_enable_logging);
    __Pyx_INCREF(__pyx_v_log_file_name);
    PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_log_file_name);
    __Pyx_GIVEREF(__pyx_v_log_file_name);
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME1)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_model = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L11;
  }

  /* "pyfmi\fmi.pyx":6324
 *     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_1 = PyInt_FromLong(__pyx_v_fmu_kind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_CS_STANDALONE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":6325
 *         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_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6325; __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_enable_logging);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_enable_logging);
    __Pyx_GIVEREF(__pyx_v_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_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_model = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_t_7);
    __pyx_t_7 = 0;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6328
 *     else:
 *         #Delete the XML
 *         if allocated_xml:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free(_fmu)
 * 
 */
    __pyx_t_9 = (__pyx_v_allocated_xml != 0);
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":6329
 *         #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":6332
 * 
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    __pyx_t_9 = (__pyx_v_allocated_context != 0);
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":6333
 *         #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":6335
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Delete the XML
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__178, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L11:;

  /* "pyfmi\fmi.pyx":6338
 * 
 *     #Delete the XML
 *     if allocated_xml:             # <<<<<<<<<<<<<<
 *         FMIL.fmi1_import_free(_fmu)
 * 
 */
  __pyx_t_9 = (__pyx_v_allocated_xml != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":6339
 *     #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":6342
 * 
 *     #Delete the context
 *     if allocated_context:             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_free_context(context)
 * 
 */
  __pyx_t_9 = (__pyx_v_allocated_context != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":6343
 *     #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":6346
 * 
 *     #Delete the created directory
 *     delete_temp_dir(fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *     return model
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_delete_temp_dir); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_fmu_temp_dir); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6346; __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 = NULL;
    __Pyx_INCREF(__pyx_v_fmu_temp_dir);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_fmu_temp_dir);
    __Pyx_GIVEREF(__pyx_v_fmu_temp_dir);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6346; __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_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

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

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

  /* function exit code */
  __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_7);
  __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((PyObject *)__pyx_v_model);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6350
 *     return model
 * 
 * def _handle_load_fmu_exception(fmu, log_file):             # <<<<<<<<<<<<<<
 *     log = []
 *     with open(log_file,'r') as file:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11_handle_load_fmu_exception(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_11_handle_load_fmu_exception = {"_handle_load_fmu_exception", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11_handle_load_fmu_exception, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5pyfmi_3fmi_11_handle_load_fmu_exception(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_log_file = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_handle_load_fmu_exception (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fmu,&__pyx_n_s_log_file,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_file)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_handle_load_fmu_exception", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6350; __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 = 6350; __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 = 6350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi._handle_load_fmu_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_10_handle_load_fmu_exception(__pyx_self, __pyx_v_fmu, __pyx_v_log_file);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_10_handle_load_fmu_exception(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_fmu, PyObject *__pyx_v_log_file) {
  PyObject *__pyx_v_log = NULL;
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_v_line = NULL;
  Py_ssize_t __pyx_v_i;
  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;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_handle_load_fmu_exception", 0);

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

  /* "pyfmi\fmi.pyx":6352
 * 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 = 6352; __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(__pyx_n_s_r);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_r);
    __Pyx_GIVEREF(__pyx_n_s_r);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_t_1;
    __pyx_t_1 = 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_v_file = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "pyfmi\fmi.pyx":6353
 *     log = []
 *     with open(log_file,'r') as file:
 *         while True:             # <<<<<<<<<<<<<<
 *             line = file.readline()
 *             if line == "":
 */
          while (1) {

            /* "pyfmi\fmi.pyx":6354
 *     with open(log_file,'r') as file:
 *         while True:
 *             line = file.readline()             # <<<<<<<<<<<<<<
 *             if line == "":
 *                 break
 */
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_readline); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6354; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_1 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
              }
            }
            if (__pyx_t_1) {
              __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6354; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            } else {
              __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6354; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            }
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_4);
            __pyx_t_4 = 0;

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

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

            /* "pyfmi\fmi.pyx":6357
 *             if line == "":
 *                 break
 *             log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(log)):
 */
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6357; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__179, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6357; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_log, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6357; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __pyx_L16_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_L14_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":6352
 * 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_2, &__pyx_t_4, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_9 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __pyx_t_12 = ((!(__pyx_t_9 != 0)) != 0);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestore(__pyx_t_2, __pyx_t_4, __pyx_t_1);
            __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_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_L8_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_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_3) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__180, NULL);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L21;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L1_error;
    __pyx_L21:;
  }

  /* "pyfmi\fmi.pyx":6359
 *             log.append(line.strip("\n"))
 * 
 *     for i in range(len(log)):             # <<<<<<<<<<<<<<
 *         print log[i]
 * 
 */
  __pyx_t_13 = PyList_GET_SIZE(__pyx_v_log); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
    __pyx_v_i = __pyx_t_14;

    /* "pyfmi\fmi.pyx":6360
 * 
 *     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 = __Pyx_GetItemInt_List(__pyx_v_log, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6360; __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 = 6360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":6350
 *     return model
 * 
 * def _handle_load_fmu_exception(fmu, log_file):             # <<<<<<<<<<<<<<
 *     log = []
 *     with open(log_file,'r') as file:
 */

  /* function exit code */
  __pyx_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._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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13load_fmu(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12load_fmu[] = "\n    Helper method for creating a model instance.\n\n    Parameters::\n\n        fmu --\n            Name of the fmu as a string.\n\n        path --\n            Path to the fmu-directory.\n            Default: '.' (working directory)\n\n        enable_logging --\n            Boolean for acesss to logging-messages.\n            Default: True\n\n        log_file_name --\n            Filename for file used to save logmessages.\n            Default: \"\" (Generates automatically)\n\n        kind --\n            String indicating the kind of model to create. This is only\n            needed if a FMU contains both a ME and CS model.\n            Availible options:\n                - 'ME'\n                - 'CS'\n                - 'auto'\n            Default: 'auto' (Chooses ME before CS if both availible)\n\n    Returns::\n\n        A model instance corresponding to the loaded FMU.\n    ";
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_13load_fmu = {"load_fmu", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13load_fmu, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_12load_fmu};
static PyObject *__pyx_pw_5pyfmi_3fmi_13load_fmu(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_kind = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_fmu (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fmu,&__pyx_n_s_path,&__pyx_n_s_enable_logging,&__pyx_n_s_log_file_name,&__pyx_n_s_kind,&__pyx_n_s_log_level,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s__10);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_kp_s__2);
    values[4] = ((PyObject *)__pyx_n_s_auto);
    values[5] = __pyx_k__181;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kind);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_log_level);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_fmu") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6362; __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 = 6362; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.load_fmu", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12load_fmu(__pyx_self, __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name, __pyx_v_kind, __pyx_v_log_level);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12load_fmu(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_kind, PyObject *__pyx_v_log_level) {
  fmi_import_context_t *__pyx_v_context;
  struct jm_callbacks __pyx_v_callbacks;
  fmi1_callback_functions_t __pyx_v_callBackFunctions_1;
  fmi2_callback_functions_t __pyx_v_callBackFunctions_2;
  jm_string __pyx_v_last_error;
  fmi_version_enu_t __pyx_v_version;
  fmi1_import_t *__pyx_v_fmu_1;
  fmi2_import_t *__pyx_v_fmu_2;
  enum fmi1_fmu_kind_enu_t __pyx_v_fmu_1_kind;
  fmi2_fmu_kind_enu_t __pyx_v_fmu_2_kind;
  char *__pyx_v_log_file_c;
  PyObject *__pyx_v_fmu_temp_dir = NULL;
  PyObject *__pyx_v_model = NULL;
  PyObject *__pyx_v_log_file = NULL;
  PyObject *__pyx_v_fmu_full_path = NULL;
  PyObject *__pyx_v_original_enable_logging = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  jm_log_level_enu_t __pyx_t_11;
  char *__pyx_t_12;
  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":6416
 * 
 *     #Variables for deallocation
 *     fmu_temp_dir = None             # <<<<<<<<<<<<<<
 *     model        = None
 *     log_file     = encode(create_temp_file())
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_fmu_temp_dir = Py_None;

  /* "pyfmi\fmi.pyx":6417
 *     #Variables for deallocation
 *     fmu_temp_dir = None
 *     model        = None             # <<<<<<<<<<<<<<
 *     log_file     = encode(create_temp_file())
 *     log_file_c = <char*>FMIL.malloc((FMIL.strlen(log_file)+1)*sizeof(char))
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_model = Py_None;

  /* "pyfmi\fmi.pyx":6418
 *     fmu_temp_dir = None
 *     model        = None
 *     log_file     = encode(create_temp_file())             # <<<<<<<<<<<<<<
 *     log_file_c = <char*>FMIL.malloc((FMIL.strlen(log_file)+1)*sizeof(char))
 *     FMIL.strcpy(log_file_c, log_file)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_create_temp_file); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6418; __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 = NULL;
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6418; __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_v_log_file = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6419
 *     model        = None
 *     log_file     = encode(create_temp_file())
 *     log_file_c = <char*>FMIL.malloc((FMIL.strlen(log_file)+1)*sizeof(char))             # <<<<<<<<<<<<<<
 *     FMIL.strcpy(log_file_c, log_file)
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_log_file); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_log_file_c = ((char *)malloc(((strlen(__pyx_t_6) + 1) * (sizeof(char)))));

  /* "pyfmi\fmi.pyx":6420
 *     log_file     = encode(create_temp_file())
 *     log_file_c = <char*>FMIL.malloc((FMIL.strlen(log_file)+1)*sizeof(char))
 *     FMIL.strcpy(log_file_c, log_file)             # <<<<<<<<<<<<<<
 * 
 *     # Check that the file referenced by fmu has the correct file-ending
 */
  __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_log_file); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_log_file_c, __pyx_t_6);

  /* "pyfmi\fmi.pyx":6423
 * 
 *     # 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_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_abspath); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_fmu_full_path = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6424
 *     # 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmu_full_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__182, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = ((!__pyx_t_9) != 0);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":6425
 *     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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__183, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6425; __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 = 6425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":6428
 * 
 *     #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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_isfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_fmu_full_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_v_fmu_full_path);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_fmu_full_path);
    __Pyx_GIVEREF(__pyx_v_fmu_full_path);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6428; __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_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = ((!__pyx_t_10) != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":6429
 *     #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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__184, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6429; __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 = 6429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pyfmi\fmi.pyx":6432
 * 
 *     #Check that kind-argument is well-defined
 *     if not kind.lower() == 'auto':             # <<<<<<<<<<<<<<
 *         if (kind.upper() != 'ME' and kind.upper() != 'CS'):
 *             raise FMUException('Input-argument "kind" can only be "ME", "CS" or "auto" (default) and not: ' + kind)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_kind, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_auto, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = ((!__pyx_t_9) != 0);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":6433
 *     #Check that kind-argument is well-defined
 *     if not kind.lower() == 'auto':
 *         if (kind.upper() != 'ME' and kind.upper() != 'CS'):             # <<<<<<<<<<<<<<
 *             raise FMUException('Input-argument "kind" can only be "ME", "CS" or "auto" (default) and not: ' + kind)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_kind, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_ME, Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_9) {
    } else {
      __pyx_t_10 = __pyx_t_9;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_kind, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_CS, Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __pyx_t_9;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":6434
 *     if not kind.lower() == 'auto':
 *         if (kind.upper() != 'ME' and kind.upper() != 'CS'):
 *             raise FMUException('Input-argument "kind" can only be "ME", "CS" or "auto" (default) and not: ' + kind)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyNumber_Add(__pyx_kp_s_Input_argument_kind_can_only_be, __pyx_v_kind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6434; __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_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 = 6434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":6438
 * 
 *     #Specify FMI related callbacks
 *     callbacks.malloc    = FMIL.malloc             # <<<<<<<<<<<<<<
 *     callbacks.calloc    = FMIL.calloc
 *     callbacks.realloc   = FMIL.realloc
 */
  __pyx_v_callbacks.malloc = malloc;

  /* "pyfmi\fmi.pyx":6439
 *     #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":6440
 *     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":6441
 *     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":6442
 *     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":6443
 *     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":6445
 *     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":6447
 *     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_2 = PyObject_RichCompare(__pyx_v_enable_logging, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_10) {

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

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

        /* "pyfmi\fmi.pyx":6450
 *         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_INCREF(Py_False);
        __Pyx_DECREF_SET(__pyx_v_enable_logging, Py_False);
        goto __pyx_L13;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":6452
 *                 enable_logging = False
 *             else:
 *                 enable_logging = True             # <<<<<<<<<<<<<<
 *             callbacks.log_level = log_level
 *         else:
 */
        __Pyx_INCREF(Py_True);
        __Pyx_DECREF_SET(__pyx_v_enable_logging, Py_True);
      }
      __pyx_L13:;

      /* "pyfmi\fmi.pyx":6453
 *             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_11 = ((jm_log_level_enu_t)PyInt_AsLong(__pyx_v_log_level)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_callbacks.log_level = __pyx_t_11;
      goto __pyx_L10;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6455
 *             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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyInt_FromLong(jm_log_level_all); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_The_log_level_must_be_between_d, __pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6455; __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_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L10:;
    goto __pyx_L9;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6457
 *             raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))
 *     else:
 *         logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")             # <<<<<<<<<<<<<<
 *         callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6457; __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_PyObject_Call(__pyx_t_2, __pyx_tuple__185, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6457; __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":6458
 *     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_10 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_10) {
      __pyx_t_11 = jm_log_level_info;
    } else {
      __pyx_t_11 = jm_log_level_error;
    }
    __pyx_v_callbacks.log_level = __pyx_t_11;
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":6467
 * 
 *     #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":6468
 *     #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":6469
 *     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":6472
 * 
 *     #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":6473
 *     #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":6474
 *     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":6478
 * 
 *     # 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":6481
 * 
 *     #Get the FMI version of the provided model
 *     fmu_temp_dir = encode(create_temp_dir())             # <<<<<<<<<<<<<<
 *     fmu_full_path = encode(fmu_full_path)
 *     version = FMIL.fmi_import_get_fmi_version(context, fmu_full_path, fmu_temp_dir)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_create_temp_dir); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_8) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_fmu_temp_dir, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6482
 *     #Get the FMI version of the provided model
 *     fmu_temp_dir = encode(create_temp_dir())
 *     fmu_full_path = encode(fmu_full_path)             # <<<<<<<<<<<<<<
 *     version = FMIL.fmi_import_get_fmi_version(context, fmu_full_path, fmu_temp_dir)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_fmu_full_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_v_fmu_full_path);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_fmu_full_path);
    __Pyx_GIVEREF(__pyx_v_fmu_full_path);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6482; __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_DECREF_SET(__pyx_v_fmu_full_path, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6483
 *     fmu_temp_dir = encode(create_temp_dir())
 *     fmu_full_path = encode(fmu_full_path)
 *     version = FMIL.fmi_import_get_fmi_version(context, fmu_full_path, fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_fmu_full_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_version = fmi_import_get_fmi_version(__pyx_v_context, __pyx_t_6, __pyx_t_12);

  /* "pyfmi\fmi.pyx":6487
 * 
 *     #Check the version
 *     if version == FMIL.fmi_version_unknown_enu:             # <<<<<<<<<<<<<<
 *         #Delete context
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 */
  __pyx_t_10 = ((__pyx_v_version == fmi_version_unknown_enu) != 0);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":6489
 *     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":6490
 *         #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":6491
 *         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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_12);

    /* "pyfmi\fmi.pyx":6492
 *         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_10 = ((__pyx_v_callbacks.log_level >= jm_log_level_error) != 0);
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":6493
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_3) {
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":6494
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = PyNumber_Add(__pyx_kp_s_The_FMU_version_could_not_be_det, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6494; __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_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6496
 *             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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (__pyx_t_5) {
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6496; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":6497
 *         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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__186, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6497; __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 = 6497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

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

    /* "pyfmi\fmi.pyx":6501
 *     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":6502
 *         #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":6503
 *         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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_12);

    /* "pyfmi\fmi.pyx":6504
 *         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_10 = ((__pyx_v_callbacks.log_level >= jm_log_level_error) != 0);
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":6505
 *         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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_3) {
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6505; __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_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyfmi\fmi.pyx":6506
 *         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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyNumber_Add(__pyx_kp_s_The_FMU_version_is_unsupported, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __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 = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6508
 *             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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (__pyx_t_8) {
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6508; __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_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

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

  /* "pyfmi\fmi.pyx":6549
 *             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)
 */
  switch (__pyx_v_version) {

    /* "pyfmi\fmi.pyx":6513
 * 
 *     #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)
 */
    case fmi_version_1_enu:

    /* "pyfmi\fmi.pyx":6515
 *     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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmu_1 = fmi1_import_parse_xml(__pyx_v_context, __pyx_t_12);

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

      /* "pyfmi\fmi.pyx":6519
 *         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":6520
 *             #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":6521
 *             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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_12);

      /* "pyfmi\fmi.pyx":6522
 *             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_10 = ((__pyx_v_callbacks.log_level >= jm_log_level_error) != 0);
      if (__pyx_t_10) {

        /* "pyfmi\fmi.pyx":6523
 *             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_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_7 = 1;
          }
        }
        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_3) {
          PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
        }
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pyfmi\fmi.pyx":6524
 *             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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = PyNumber_Add(__pyx_kp_s_The_XML_could_not_be_read, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6524; __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_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":6526
 *                 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_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_7 = 1;
          }
        }
        __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        if (__pyx_t_5) {
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6526; __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pyfmi\fmi.pyx":6527
 *             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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__188, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6527; __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 = 6527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }

    /* "pyfmi\fmi.pyx":6529
 *                 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":6532
 * 
 *         #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_2 = PyInt_FromLong(__pyx_v_fmu_1_kind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_ME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_9) {
    } else {
      __pyx_t_10 = __pyx_t_9;
      goto __pyx_L21_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_kind, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_CS, Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = __pyx_t_9;
    __pyx_L21_bool_binop_done:;
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":6533
 *         #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_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      __Pyx_INCREF(__pyx_v_original_enable_logging);
      PyTuple_SET_ITEM(__pyx_t_3, 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_3, 3, __pyx_v_log_file_name);
      __Pyx_GIVEREF(__pyx_v_log_file_name);
      __Pyx_INCREF(__pyx_v_log_level);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_log_level);
      __Pyx_GIVEREF(__pyx_v_log_level);
      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME1)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_model, __pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L20;
    }

    /* "pyfmi\fmi.pyx":6534
 *         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_1 = PyInt_FromLong(__pyx_v_fmu_1_kind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_CS_STANDALONE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_9) {
    } else {
      __pyx_t_10 = __pyx_t_9;
      goto __pyx_L23_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_kind, __pyx_n_s_upper); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_ME, Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __pyx_t_9;
    __pyx_L23_bool_binop_done:;
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":6535
 *             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 = 6535; __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_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_model, __pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L20;
    }

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

      /* "pyfmi\fmi.pyx":6537
 *             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":6538
 *         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":6539
 *             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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_12);

      /* "pyfmi\fmi.pyx":6540
 *             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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_1) {
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6540; __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":6541
 *             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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__189, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6541; __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 = 6541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6543
 *             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":6544
 *         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":6545
 *             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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_12);

      /* "pyfmi\fmi.pyx":6546
 *             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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (__pyx_t_5) {
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6546; __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_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyfmi\fmi.pyx":6547
 *             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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyBytes_FromString(fmi1_fmu_kind_to_string(__pyx_v_fmu_1_kind)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyNumber_Add(__pyx_kp_s_FMU_is_a, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_kp_s_and_not_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_kind, __pyx_n_s_upper); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6547; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6547; __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_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 = 6547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L20:;
    break;

    /* "pyfmi\fmi.pyx":6549
 *             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)
 */
    case fmi_version_2_0_enu:

    /* "pyfmi\fmi.pyx":6551
 *     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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmu_2 = fmi2_import_parse_xml(__pyx_v_context, __pyx_t_12, NULL);

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

      /* "pyfmi\fmi.pyx":6555
 *         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":6556
 *             #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":6557
 *             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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_12);

      /* "pyfmi\fmi.pyx":6558
 *             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_10 = ((__pyx_v_callbacks.log_level >= jm_log_level_error) != 0);
      if (__pyx_t_10) {

        /* "pyfmi\fmi.pyx":6559
 *             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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_7 = 1;
          }
        }
        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_1) {
          PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
        }
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":6560
 *             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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = PyNumber_Add(__pyx_kp_s_The_XML_could_not_be_read, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __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 = 6560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":6562
 *                 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_7 = 1;
          }
        }
        __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        if (__pyx_t_5) {
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6562; __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_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":6563
 *             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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__190, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6563; __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 = 6563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }

    /* "pyfmi\fmi.pyx":6565
 *                 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":6568
 * 
 *         #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_10 = ((__pyx_v_fmu_2_kind == fmi2_fmu_kind_unknown) != 0);
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":6569
 *         #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":6570
 *         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":6571
 *             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":6572
 *             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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_12);

      /* "pyfmi\fmi.pyx":6573
 *             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_10 = ((__pyx_v_callbacks.log_level >= jm_log_level_error) != 0);
      if (__pyx_t_10) {

        /* "pyfmi\fmi.pyx":6574
 *             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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_7 = 1;
          }
        }
        __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_1) {
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
        }
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6574; __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "pyfmi\fmi.pyx":6575
 *             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_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = PyNumber_Add(__pyx_kp_s_The_FMU_kind_could_not_be_determ, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_5) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
          PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __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 = 6575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":6577
 *                 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_7 = 1;
          }
        }
        __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        if (__pyx_t_8) {
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6577; __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "pyfmi\fmi.pyx":6578
 *             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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__191, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6578; __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 = 6578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }

    /* "pyfmi\fmi.pyx":6581
 * 
 *         #FMU kind is known
 *         if kind.lower() == 'auto':             # <<<<<<<<<<<<<<
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_kind, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_auto, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":6582
 *         #FMU kind is known
 *         if kind.lower() == 'auto':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs:             # <<<<<<<<<<<<<<
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 *             elif fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 */
      __pyx_t_10 = ((__pyx_v_fmu_2_kind == fmi2_fmu_kind_cs) != 0);
      if (__pyx_t_10) {

        /* "pyfmi\fmi.pyx":6583
 *         if kind.lower() == 'auto':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)             # <<<<<<<<<<<<<<
 *             elif fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)
 */
        __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6583; __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_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF_SET(__pyx_v_model, __pyx_t_3);
        __pyx_t_3 = 0;
        goto __pyx_L30;
      }

      /* "pyfmi\fmi.pyx":6584
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 *             elif fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:             # <<<<<<<<<<<<<<
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif kind.upper() == 'CS':
 */
      __pyx_t_9 = ((__pyx_v_fmu_2_kind == fmi2_fmu_kind_me) != 0);
      if (!__pyx_t_9) {
      } else {
        __pyx_t_10 = __pyx_t_9;
        goto __pyx_L31_bool_binop_done;
      }
      __pyx_t_9 = ((__pyx_v_fmu_2_kind == fmi2_fmu_kind_me_and_cs) != 0);
      __pyx_t_10 = __pyx_t_9;
      __pyx_L31_bool_binop_done:;
      if (__pyx_t_10) {

        /* "pyfmi\fmi.pyx":6585
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 *             elif fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)             # <<<<<<<<<<<<<<
 *         elif kind.upper() == 'CS':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 */
        __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_path);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path);
        __Pyx_GIVEREF(__pyx_v_path);
        __Pyx_INCREF(__pyx_v_original_enable_logging);
        PyTuple_SET_ITEM(__pyx_t_3, 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_3, 3, __pyx_v_log_file_name);
        __Pyx_GIVEREF(__pyx_v_log_file_name);
        __Pyx_INCREF(__pyx_v_log_level);
        PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_log_level);
        __Pyx_GIVEREF(__pyx_v_log_level);
        __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME2)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF_SET(__pyx_v_model, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L30;
      }
      __pyx_L30:;
      goto __pyx_L29;
    }

    /* "pyfmi\fmi.pyx":6586
 *             elif fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif kind.upper() == 'CS':             # <<<<<<<<<<<<<<
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_kind, __pyx_n_s_upper); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_CS, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":6587
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif kind.upper() == 'CS':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:             # <<<<<<<<<<<<<<
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif kind.upper() == 'ME':
 */
      __pyx_t_9 = ((__pyx_v_fmu_2_kind == fmi2_fmu_kind_cs) != 0);
      if (!__pyx_t_9) {
      } else {
        __pyx_t_10 = __pyx_t_9;
        goto __pyx_L34_bool_binop_done;
      }
      __pyx_t_9 = ((__pyx_v_fmu_2_kind == fmi2_fmu_kind_me_and_cs) != 0);
      __pyx_t_10 = __pyx_t_9;
      __pyx_L34_bool_binop_done:;
      if (__pyx_t_10) {

        /* "pyfmi\fmi.pyx":6588
 *         elif kind.upper() == 'CS':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)             # <<<<<<<<<<<<<<
 *         elif kind.upper() == 'ME':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 */
        __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6588; __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_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF_SET(__pyx_v_model, __pyx_t_3);
        __pyx_t_3 = 0;
        goto __pyx_L33;
      }
      __pyx_L33:;
      goto __pyx_L29;
    }

    /* "pyfmi\fmi.pyx":6589
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif kind.upper() == 'ME':             # <<<<<<<<<<<<<<
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_kind, __pyx_n_s_upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_1) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_ME, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":6590
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif kind.upper() == 'ME':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:             # <<<<<<<<<<<<<<
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)
 * 
 */
      __pyx_t_9 = ((__pyx_v_fmu_2_kind == fmi2_fmu_kind_me) != 0);
      if (!__pyx_t_9) {
      } else {
        __pyx_t_10 = __pyx_t_9;
        goto __pyx_L37_bool_binop_done;
      }
      __pyx_t_9 = ((__pyx_v_fmu_2_kind == fmi2_fmu_kind_me_and_cs) != 0);
      __pyx_t_10 = __pyx_t_9;
      __pyx_L37_bool_binop_done:;
      if (__pyx_t_10) {

        /* "pyfmi\fmi.pyx":6591
 *         elif kind.upper() == 'ME':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)             # <<<<<<<<<<<<<<
 * 
 *         #Could not match FMU kind with input-specified kind
 */
        __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_path);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path);
        __Pyx_GIVEREF(__pyx_v_path);
        __Pyx_INCREF(__pyx_v_original_enable_logging);
        PyTuple_SET_ITEM(__pyx_t_3, 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_3, 3, __pyx_v_log_file_name);
        __Pyx_GIVEREF(__pyx_v_log_file_name);
        __Pyx_INCREF(__pyx_v_log_level);
        PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_log_level);
        __Pyx_GIVEREF(__pyx_v_log_level);
        __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME2)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF_SET(__pyx_v_model, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L36;
      }
      __pyx_L36:;
      goto __pyx_L29;
    }
    __pyx_L29:;

    /* "pyfmi\fmi.pyx":6594
 * 
 *         #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_10 = (__pyx_v_model == Py_None);
    __pyx_t_9 = (__pyx_t_10 != 0);
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":6595
 *         #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":6596
 *         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":6597
 *             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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_12);

      /* "pyfmi\fmi.pyx":6598
 *             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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_1) {
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyfmi\fmi.pyx":6599
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException('FMU is a ' + FMIL.fmi2_fmu_kind_to_string(fmu_2_kind) + ' and not a ' + kind.upper())             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_PyBytes_FromString(fmi2_fmu_kind_to_string(__pyx_v_fmu_2_kind)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = PyNumber_Add(__pyx_kp_s_FMU_is_a, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Add(__pyx_t_1, __pyx_kp_s_and_not_a); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_kind, __pyx_n_s_upper); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Add(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6599; __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); __pyx_t_1 = NULL;
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __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 = 6599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    break;
    default:

    /* "pyfmi\fmi.pyx":6605
 * 
 *         #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":6606
 *         #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":6607
 *         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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_12);

    /* "pyfmi\fmi.pyx":6608
 *         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_9 = ((__pyx_v_callbacks.log_level >= jm_log_level_error) != 0);
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":6609
 *         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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_8) {
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6609; __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_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyfmi\fmi.pyx":6610
 *         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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = PyNumber_Add(__pyx_kp_s_The_FMU_version_is_not_found, __pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6610; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6610; __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_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 = 6610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6612
 *             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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_handle_load_fmu_exception); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_1) {
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyfmi\fmi.pyx":6613
 *         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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__192, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6613; __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 = 6613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    break;
  }

  /* "pyfmi\fmi.pyx":6616
 * 
 *     #Delete
 *     if version == FMIL.fmi_version_1_enu:             # <<<<<<<<<<<<<<
 *         FMIL.fmi1_import_free(fmu_1)
 *         FMIL.fmi_import_free_context(context)
 */
  __pyx_t_9 = ((__pyx_v_version == fmi_version_1_enu) != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":6617
 *     #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":6618
 *     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":6619
 *         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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_12);
    goto __pyx_L41;
  }
  __pyx_L41:;

  /* "pyfmi\fmi.pyx":6621
 *         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_9 = ((__pyx_v_version == fmi_version_2_0_enu) != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":6622
 * 
 *     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":6623
 *     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":6624
 *         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_12 = __Pyx_PyObject_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_12);
    goto __pyx_L42;
  }
  __pyx_L42:;

  /* "pyfmi\fmi.pyx":6627
 * 
 *     #Delete log file
 *     delete_temp_file(log_file)             # <<<<<<<<<<<<<<
 *     FMIL.free(log_file_c)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_delete_temp_file); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_log_file); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_v_log_file);
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_log_file);
    __Pyx_GIVEREF(__pyx_v_log_file);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6627; __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":6628
 *     #Delete log file
 *     delete_temp_file(log_file)
 *     FMIL.free(log_file_c)             # <<<<<<<<<<<<<<
 * 
 *     return model
 */
  free(__pyx_v_log_file_c);

  /* "pyfmi\fmi.pyx":6630
 *     FMIL.free(log_file_c)
 * 
 *     return model             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_model);
  __pyx_r = __pyx_v_model;
  goto __pyx_L0;

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

  /* function exit code */
  __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_8);
  __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;
}

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":194
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  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);
  }

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":200
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":203
 * 
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":204
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":206
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":208
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":209
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":211
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":213
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":214
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":215
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__193, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __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 = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":217
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L9_bool_binop_done;
  }

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":218
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_1) {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":219
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__194, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; __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 = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":221
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":222
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":223
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  __pyx_t_1 = (__pyx_v_copy_shape != 0);
  if (__pyx_t_1) {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":226
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":227
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":228
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_4 = __pyx_v_ndim;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":229
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":230
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }
    goto __pyx_L11;
  }
  /*else*/ {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":232
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":233
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  }
  __pyx_L11:;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":234
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 */
  __pyx_v_info->suboffsets = NULL;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":235
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":236
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":239
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":240
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 *             cdef int offset
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":244
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":246
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_1) {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":248
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;
    goto __pyx_L14;
  }
  /*else*/ {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":251
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  }
  __pyx_L14:;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":253
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_1) {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":254
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 */
    __pyx_t_4 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_4;

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":255
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
    if (!__pyx_t_2) {
      goto __pyx_L20_next_or;
    } else {
    }
    __pyx_t_2 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_L20_next_or:;

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":256
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L19_bool_binop_done:;
    if (__pyx_t_1) {

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":257
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__195, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; __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 = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":274
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
    switch (__pyx_v_t) {

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":258
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
      case NPY_BYTE:
      __pyx_v_f = __pyx_k_b;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":259
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
      case NPY_UBYTE:
      __pyx_v_f = __pyx_k_B;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":260
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
      case NPY_SHORT:
      __pyx_v_f = __pyx_k_h;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":261
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
      case NPY_USHORT:
      __pyx_v_f = __pyx_k_H;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":262
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
      case NPY_INT:
      __pyx_v_f = __pyx_k_i;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":263
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
      case NPY_UINT:
      __pyx_v_f = __pyx_k_I;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":264
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
      case NPY_LONG:
      __pyx_v_f = __pyx_k_l;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":265
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
      case NPY_ULONG:
      __pyx_v_f = __pyx_k_L;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":266
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
      case NPY_LONGLONG:
      __pyx_v_f = __pyx_k_q;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":267
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
      case NPY_ULONGLONG:
      __pyx_v_f = __pyx_k_Q;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":268
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
      case NPY_FLOAT:
      __pyx_v_f = __pyx_k_f;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":269
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
      case NPY_DOUBLE:
      __pyx_v_f = __pyx_k_d;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":270
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
      case NPY_LONGDOUBLE:
      __pyx_v_f = __pyx_k_g;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":271
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
      case NPY_CFLOAT:
      __pyx_v_f = __pyx_k_Zf;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":272
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
      case NPY_CDOUBLE:
      __pyx_v_f = __pyx_k_Zd;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":273
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
      case NPY_CLONGDOUBLE:
      __pyx_v_f = __pyx_k_Zg;
      break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":274
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      case NPY_OBJECT:
      __pyx_v_f = __pyx_k_O;
      break;
      default:

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":276
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;
    }

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":277
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":278
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":280
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 */
    __pyx_v_info->format = ((char *)malloc(255));

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":281
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":282
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":283
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 */
    __pyx_t_7 = __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_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_7;

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":286
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = '\x00';
  }

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":194
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __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;
}

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":288
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

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

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":289
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  if (__pyx_t_1) {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":290
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":291
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":292
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":288
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":768
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":769
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":768
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

  /* function exit code */
  __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;
}

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":771
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":772
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":771
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

  /* function exit code */
  __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;
}

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":774
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":775
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":774
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

  /* function exit code */
  __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;
}

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":777
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":778
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":777
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

  /* function exit code */
  __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;
}

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":780
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":781
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":780
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

  /* function exit code */
  __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;
}

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":783
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  char *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":790
 *     cdef int delta_offset
 *     cdef tuple i
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":791
 *     cdef tuple i
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(__pyx_v_descr->names == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":795
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":796
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 */
    if (likely(__pyx_v_fields != Py_None)) {
      PyObject* sequence = __pyx_v_fields;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __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 = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":798
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
    if (__pyx_t_6) {

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":799
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__196, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __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 = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
    if (!__pyx_t_7) {
      goto __pyx_L8_next_or;
    } else {
    }
    __pyx_t_7 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_L8_next_or:;

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":802
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_6) {

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":803
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__197, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __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 = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":813
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_6) break;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":814
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 120;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":815
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":816
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_8 = 0;
      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
    }

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":818
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_8 = 0;
    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":820
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
    if (__pyx_t_6) {

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.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_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":822
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
      if (__pyx_t_6) {

        /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":823
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__198, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __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 = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":826
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[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]) = 98;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":827
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); 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_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":828
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[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]) = 104;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":829
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_USHORT); 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_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":830
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[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]) = 105;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":831
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_UINT); 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_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":832
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[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]) = 108;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":833
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_ULONG); 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_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":834
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[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]) = 113;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":835
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); 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_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":836
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[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]) = 102;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":837
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); 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_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 100;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":838
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[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]) = 103;
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":839
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); 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_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 102;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":840
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[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]) = 100;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":841
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); 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_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 103;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":842
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":844
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __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[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L15:;

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":845
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);
      goto __pyx_L13;
    }
    /*else*/ {

      /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":849
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L13:;

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":850
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":783
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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;
}

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":966
 * 
 * 
 * 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;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":968
 * 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);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":969
 *      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*/ {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":971
 *          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);

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":972
 *      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:;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":973
 *          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);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":974
 *          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;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":966
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":976
 *      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);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":977
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  if (__pyx_t_1) {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":978
 * 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;
  }
  /*else*/ {

    /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":980
 *         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;
  }

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":976
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_5pyfmi_3fmi_ModelBase(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_ModelBase(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_ModelBase[] = {
  {"set", (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_1set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_9ModelBase_set},
  {"get", (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_3get, METH_O, __pyx_doc_5pyfmi_3fmi_9ModelBase_2get},
  {"_exec_algorithm", (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_5_exec_algorithm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_9ModelBase_4_exec_algorithm},
  {"_exec_simulate_algorithm", (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_7_exec_simulate_algorithm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_9ModelBase_6_exec_simulate_algorithm},
  {"_default_options", (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_9_default_options, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_9ModelBase_8_default_options},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_ModelBase = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_5pyfmi_3fmi_ScalarVariable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!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;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_name);
  Py_CLEAR(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) {
  PyObject* tmp;
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *p = (struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)o;
  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[] = {
  {"_get_name", (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_3_get_name, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_14ScalarVariable_2_get_name},
  {"_get_value_reference", (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_5_get_value_reference, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_14ScalarVariable_4_get_value_reference},
  {"_get_type", (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_7_get_type, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_14ScalarVariable_6_get_type},
  {"_get_description", (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_9_get_description, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_14ScalarVariable_8_get_description},
  {"_get_variability", (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_11_get_variability, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_14ScalarVariable_10_get_variability},
  {"_get_causality", (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_13_get_causality, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_14ScalarVariable_12_get_causality},
  {"_get_alias", (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_15_get_alias, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_14ScalarVariable_14_get_alias},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_ScalarVariable = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_5pyfmi_3fmi_ScalarVariable2(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!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;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_name);
  Py_CLEAR(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) {
  PyObject* tmp;
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *p = (struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)o;
  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[] = {
  {"_get_name", (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_3_get_name, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_2_get_name},
  {"_get_value_reference", (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_5_get_value_reference, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_4_get_value_reference},
  {"_get_type", (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_7_get_type, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_6_get_type},
  {"_get_description", (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_9_get_description, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_8_get_description},
  {"_get_variability", (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_11_get_variability, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_10_get_variability},
  {"_get_causality", (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_13_get_causality, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_12_get_causality},
  {"_get_alias", (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_15_get_alias, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_14_get_alias},
  {"_get_initial", (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_17_get_initial, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_16_get_initial},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_ScalarVariable2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUState2(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_FMUState2(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUState2[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_FMUState2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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 (unlikely(!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;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__t);
  Py_CLEAR(p->_file_open);
  Py_CLEAR(p->_npoints);
  Py_CLEAR(p->_enable_logging);
  Py_CLEAR(p->_pyEventInfo);
  Py_CLEAR(p->_log);
  Py_CLEAR(p->_allocated_list);
  Py_CLEAR(p->_modelid);
  Py_CLEAR(p->_modelname);
  Py_CLEAR(p->_save_real_variables_val);
  Py_CLEAR(p->_save_int_variables_val);
  Py_CLEAR(p->_save_bool_variables_val);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_ModelBase(o);
}

static int __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)o;
  e = ((likely(__pyx_ptype_5pyfmi_3fmi_ModelBase)) ? ((__pyx_ptype_5pyfmi_3fmi_ModelBase->tp_traverse) ? __pyx_ptype_5pyfmi_3fmi_ModelBase->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase)); if (e) return e;
  if (p->__t) {
    e = (*v)(p->__t, a); if (e) return e;
  }
  if (p->_file_open) {
    e = (*v)(p->_file_open, a); if (e) return e;
  }
  if (p->_npoints) {
    e = (*v)(p->_npoints, a); if (e) return e;
  }
  if (p->_enable_logging) {
    e = (*v)(p->_enable_logging, a); if (e) return e;
  }
  if (p->_pyEventInfo) {
    e = (*v)(p->_pyEventInfo, a); if (e) return e;
  }
  if (p->_log) {
    e = (*v)(p->_log, a); if (e) return e;
  }
  if (p->_allocated_list) {
    e = (*v)(p->_allocated_list, a); if (e) return e;
  }
  if (p->_modelid) {
    e = (*v)(p->_modelid, a); if (e) return e;
  }
  if (p->_modelname) {
    e = (*v)(p->_modelname, a); if (e) return e;
  }
  if (p->_save_real_variables_val) {
    e = (*v)(p->_save_real_variables_val, a); if (e) return e;
  }
  if (p->_save_int_variables_val) {
    e = (*v)(p->_save_int_variables_val, a); if (e) return e;
  }
  if (p->_save_bool_variables_val) {
    e = (*v)(p->_save_bool_variables_val, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)o;
  if (likely(__pyx_ptype_5pyfmi_3fmi_ModelBase)) { if (__pyx_ptype_5pyfmi_3fmi_ModelBase->tp_clear) __pyx_ptype_5pyfmi_3fmi_ModelBase->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase);
  tmp = ((PyObject*)p->__t);
  p->__t = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_file_open);
  p->_file_open = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_npoints);
  p->_npoints = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_enable_logging);
  p->_enable_logging = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_pyEventInfo);
  p->_pyEventInfo = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_log);
  p->_log = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_allocated_list);
  p->_allocated_list = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_modelid);
  p->_modelid = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_modelname);
  p->_modelname = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_save_real_variables_val);
  p->_save_real_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_save_int_variables_val);
  p->_save_int_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_save_bool_variables_val);
  p->_save_bool_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase___t(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase___t(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__file_open(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__file_open(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__npoints(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__npoints(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__enable_logging(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__enable_logging(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__pyEventInfo(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__pyEventInfo(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_real_variables_val(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_real_variables_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_int_variables_val(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_int_variables_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_bool_variables_val(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_bool_variables_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelBase[] = {
  {"append_log_message", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3append_log_message, METH_VARARGS|METH_KEYWORDS, 0},
  {"get_log", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_5get_log, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_4get_log},
  {"_internal_set_fmu_null", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_7_internal_set_fmu_null, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_6_internal_set_fmu_null},
  {"print_log", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_9print_log, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_8print_log},
  {"_convert_filter", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_11_convert_filter, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_10_convert_filter},
  {"_get_version", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_13_get_version, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_12_get_version},
  {"get_ode_sizes", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15get_ode_sizes, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_14get_ode_sizes},
  {"get_real", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_17get_real, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_16get_real},
  {"set_real", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_19set_real, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_18set_real},
  {"get_integer", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_21get_integer, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_20get_integer},
  {"set_integer", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23set_integer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_22set_integer},
  {"get_boolean", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_25get_boolean, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_24get_boolean},
  {"set_boolean", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_27set_boolean, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_26set_boolean},
  {"get_string", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_29get_string, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_28get_string},
  {"set_string", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_31set_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_30set_string},
  {"set_debug_logging", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_33set_debug_logging, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_32set_debug_logging},
  {"set_log_level", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35set_log_level, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_34set_log_level},
  {"set_fmil_log_level", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37set_fmil_log_level, METH_O, 0},
  {"_set", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_38_set},
  {"_get", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41_get, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_40_get},
  {"get_variable_description", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_description, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_42get_variable_description},
  {"get_variable_data_type", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_data_type, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_44get_variable_data_type},
  {"get_variable_valueref", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_valueref, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_46get_variable_valueref},
  {"get_variable_nominal", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_variable_nominal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_48get_variable_nominal},
  {"get_variable_fixed", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51get_variable_fixed, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_50get_variable_fixed},
  {"get_variable_start", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_variable_start, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_52get_variable_start},
  {"get_variable_max", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_max, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_54get_variable_max},
  {"get_variable_min", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_min, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_56get_variable_min},
  {"get_model_variables", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_59get_model_variables, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_58get_model_variables},
  {"get_model_time_varying_value_references", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_model_time_varying_value_references, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_60get_model_time_varying_value_references},
  {"get_variable_alias_base", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_63get_variable_alias_base, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_62get_variable_alias_base},
  {"get_variable_alias", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_variable_alias, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_64get_variable_alias},
  {"get_variable_variability", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_variable_variability, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_66get_variable_variability},
  {"get_variable_by_valueref", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_variable_by_valueref, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_68get_variable_by_valueref},
  {"get_variable_causality", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_variable_causality, METH_O, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_70get_variable_causality},
  {"get_name", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_73get_name, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_72get_name},
  {"get_identifier", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_75get_identifier, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_74get_identifier},
  {"get_author", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_77get_author, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_76get_author},
  {"get_default_experiment_start_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_79get_default_experiment_start_time, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_78get_default_experiment_start_time},
  {"get_default_experiment_stop_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_81get_default_experiment_stop_time, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_80get_default_experiment_stop_time},
  {"get_default_experiment_tolerance", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_83get_default_experiment_tolerance, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_82get_default_experiment_tolerance},
  {"get_description", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_85get_description, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_84get_description},
  {"get_generation_tool", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_87get_generation_tool, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_86get_generation_tool},
  {"get_guid", (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_89get_guid, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_12FMUModelBase_88get_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 PyTypeObject __pyx_type_5pyfmi_3fmi_FMUModelBase = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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 (unlikely(!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) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_7__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelCS1[] = {
  {"_get_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_3_get_time, METH_NOARGS, 0},
  {"_set_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_5_set_time, METH_O, 0},
  {"do_step", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_9do_step, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_8do_step},
  {"cancel_step", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_11cancel_step, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_10cancel_step},
  {"get_output_derivatives", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_13get_output_derivatives, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives},
  {"_get_types_platform", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_15_get_types_platform, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_14_get_types_platform},
  {"get_real_status", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_17get_real_status, METH_O, __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_16get_real_status},
  {"set_input_derivatives", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_19set_input_derivatives, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_18set_input_derivatives},
  {"simulate", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_21simulate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_20simulate},
  {"simulate_options", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_23simulate_options, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_22simulate_options},
  {"initialize", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_25initialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_24initialize},
  {"reset", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_27reset, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_26reset},
  {"instantiate_slave", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_29instantiate_slave, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_28instantiate_slave},
  {"get_capability_flags", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_31get_capability_flags, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_30get_capability_flags},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_FMUModelCS1 = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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 (unlikely(!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) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_5pyfmi_3fmi_11FMUModelME1_7__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelME1[] = {
  {"_get_model_types_platform", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_3_get_model_types_platform, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_2_get_model_types_platform},
  {"reset", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_5reset, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_4reset},
  {"_get_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_9_get_time, METH_NOARGS, 0},
  {"_set_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_11_set_time, METH_O, 0},
  {"_get_continuous_states", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_13_get_continuous_states, METH_NOARGS, 0},
  {"_set_continuous_states", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_15_set_continuous_states, METH_O, 0},
  {"_get_nominal_continuous_states", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_17_get_nominal_continuous_states, METH_NOARGS, 0},
  {"get_derivatives", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_19get_derivatives, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_18get_derivatives},
  {"get_event_indicators", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_21get_event_indicators, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_20get_event_indicators},
  {"get_tolerances", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_23get_tolerances, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_22get_tolerances},
  {"event_update", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_25event_update, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_24event_update},
  {"get_event_info", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_27get_event_info, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_26get_event_info},
  {"get_state_value_references", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_29get_state_value_references, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_28get_state_value_references},
  {"completed_integrator_step", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_31completed_integrator_step, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_30completed_integrator_step},
  {"initialize", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_33initialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_32initialize},
  {"instantiate_model", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_35instantiate_model, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_34instantiate_model},
  {"simulate", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_37simulate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_36simulate},
  {"simulate_options", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_39simulate_options, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_38simulate_options},
  {"terminate", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_41terminate, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME1_40terminate},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_FMUModelME1 = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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 (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)o);
  p->__pyx_vtab = __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2;
  p->_log = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_fmu_full_path = Py_None; Py_INCREF(Py_None);
  p->_enable_logging = Py_None; Py_INCREF(Py_None);
  p->_modelId = Py_None; Py_INCREF(Py_None);
  p->_modelName = Py_None; Py_INCREF(Py_None);
  p->_categories = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_save_real_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_save_int_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_save_bool_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->__pyx___t = Py_None; Py_INCREF(Py_None);
  p->_pyEventInfo = Py_None; Py_INCREF(Py_None);
  p->_states_references = Py_None; Py_INCREF(Py_None);
  p->_inputs_references = Py_None; Py_INCREF(Py_None);
  p->_outputs_references = Py_None; Py_INCREF(Py_None);
  p->_derivatives_references = Py_None; Py_INCREF(Py_None);
  p->_A = Py_None; Py_INCREF(Py_None);
  p->_B = Py_None; Py_INCREF(Py_None);
  p->_C = Py_None; Py_INCREF(Py_None);
  p->_D = Py_None; Py_INCREF(Py_None);
  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;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_log);
  Py_CLEAR(p->_fmu_full_path);
  Py_CLEAR(p->_enable_logging);
  Py_CLEAR(p->_modelId);
  Py_CLEAR(p->_modelName);
  Py_CLEAR(p->_categories);
  Py_CLEAR(p->_save_real_variables_val);
  Py_CLEAR(p->_save_int_variables_val);
  Py_CLEAR(p->_save_bool_variables_val);
  Py_CLEAR(p->__pyx___t);
  Py_CLEAR(p->_pyEventInfo);
  Py_CLEAR(p->_states_references);
  Py_CLEAR(p->_inputs_references);
  Py_CLEAR(p->_outputs_references);
  Py_CLEAR(p->_derivatives_references);
  Py_CLEAR(p->_A);
  Py_CLEAR(p->_B);
  Py_CLEAR(p->_C);
  Py_CLEAR(p->_D);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_ModelBase(o);
}

static int __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase2(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)o;
  e = ((likely(__pyx_ptype_5pyfmi_3fmi_ModelBase)) ? ((__pyx_ptype_5pyfmi_3fmi_ModelBase->tp_traverse) ? __pyx_ptype_5pyfmi_3fmi_ModelBase->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase2)); if (e) return e;
  if (p->_log) {
    e = (*v)(p->_log, a); if (e) return e;
  }
  if (p->_fmu_full_path) {
    e = (*v)(p->_fmu_full_path, a); if (e) return e;
  }
  if (p->_enable_logging) {
    e = (*v)(p->_enable_logging, a); if (e) return e;
  }
  if (p->_modelId) {
    e = (*v)(p->_modelId, a); if (e) return e;
  }
  if (p->_modelName) {
    e = (*v)(p->_modelName, a); if (e) return e;
  }
  if (p->_categories) {
    e = (*v)(p->_categories, a); if (e) return e;
  }
  if (p->_save_real_variables_val) {
    e = (*v)(p->_save_real_variables_val, a); if (e) return e;
  }
  if (p->_save_int_variables_val) {
    e = (*v)(p->_save_int_variables_val, a); if (e) return e;
  }
  if (p->_save_bool_variables_val) {
    e = (*v)(p->_save_bool_variables_val, a); if (e) return e;
  }
  if (p->__pyx___t) {
    e = (*v)(p->__pyx___t, a); if (e) return e;
  }
  if (p->_pyEventInfo) {
    e = (*v)(p->_pyEventInfo, a); if (e) return e;
  }
  if (p->_states_references) {
    e = (*v)(p->_states_references, a); if (e) return e;
  }
  if (p->_inputs_references) {
    e = (*v)(p->_inputs_references, a); if (e) return e;
  }
  if (p->_outputs_references) {
    e = (*v)(p->_outputs_references, a); if (e) return e;
  }
  if (p->_derivatives_references) {
    e = (*v)(p->_derivatives_references, a); if (e) return e;
  }
  if (p->_A) {
    e = (*v)(p->_A, a); if (e) return e;
  }
  if (p->_B) {
    e = (*v)(p->_B, a); if (e) return e;
  }
  if (p->_C) {
    e = (*v)(p->_C, a); if (e) return e;
  }
  if (p->_D) {
    e = (*v)(p->_D, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase2(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)o;
  if (likely(__pyx_ptype_5pyfmi_3fmi_ModelBase)) { if (__pyx_ptype_5pyfmi_3fmi_ModelBase->tp_clear) __pyx_ptype_5pyfmi_3fmi_ModelBase->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase2);
  tmp = ((PyObject*)p->_log);
  p->_log = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_fmu_full_path);
  p->_fmu_full_path = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_enable_logging);
  p->_enable_logging = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_modelId);
  p->_modelId = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_modelName);
  p->_modelName = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_categories);
  p->_categories = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_save_real_variables_val);
  p->_save_real_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_save_int_variables_val);
  p->_save_int_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_save_bool_variables_val);
  p->_save_bool_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx___t);
  p->__pyx___t = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_pyEventInfo);
  p->_pyEventInfo = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_states_references);
  p->_states_references = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_inputs_references);
  p->_inputs_references = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_outputs_references);
  p->_outputs_references = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_derivatives_references);
  p->_derivatives_references = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_A);
  p->_A = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_B);
  p->_B = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_C);
  p->_C = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_D);
  p->_D = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__enable_logging(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__enable_logging(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_real_variables_val(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__save_real_variables_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_int_variables_val(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__save_int_variables_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_bool_variables_val(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__save_bool_variables_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__pyEventInfo(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__pyEventInfo(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelBase2[] = {
  {"get_real", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_3get_real, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_2get_real},
  {"set_real", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_5set_real, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_4set_real},
  {"get_integer", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_7get_integer, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_6get_integer},
  {"set_integer", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_9set_integer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_8set_integer},
  {"get_boolean", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_11get_boolean, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_10get_boolean},
  {"set_boolean", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13set_boolean, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_12set_boolean},
  {"get_string", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15get_string, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_14get_string},
  {"set_string", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_17set_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_16set_string},
  {"_set", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_19_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_18_set},
  {"_get", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_21_get, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_20_get},
  {"get_log", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23get_log, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_22get_log},
  {"print_log", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_25print_log, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_24print_log},
  {"instantiate", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_27instantiate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_26instantiate},
  {"setup_experiment", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_29setup_experiment, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_28setup_experiment},
  {"reset", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_31reset, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_30reset},
  {"terminate", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_33terminate, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_32terminate},
  {"initialize", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_35initialize, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_34initialize},
  {"set_fmil_log_level", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_37set_fmil_log_level, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_36set_fmil_log_level},
  {"get_fmil_log_level", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_39get_fmil_log_level, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_38get_fmil_log_level},
  {"set_debug_logging", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_41set_debug_logging, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_40set_debug_logging},
  {"get_categories", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_43get_categories, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_42get_categories},
  {"get_variable_nominal", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_45get_variable_nominal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_44get_variable_nominal},
  {"get_variable_by_valueref", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_47get_variable_by_valueref, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_46get_variable_by_valueref},
  {"get_variable_alias_base", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_49get_variable_alias_base, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_48get_variable_alias_base},
  {"get_variable_alias", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_51get_variable_alias, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_50get_variable_alias},
  {"get_model_time_varying_value_references", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_53get_model_time_varying_value_references, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_52get_model_time_varying_value_references},
  {"get_model_variables", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_55get_model_variables, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_54get_model_variables},
  {"get_variable_references", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_57get_variable_references, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_56get_variable_references},
  {"get_variable_valueref", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_59get_variable_valueref, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_58get_variable_valueref},
  {"get_variable_data_type", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_data_type, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_60get_variable_data_type},
  {"get_variable_description", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_description, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_62get_variable_description},
  {"get_variable_variability", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_65get_variable_variability, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_64get_variable_variability},
  {"get_variable_initial", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67get_variable_initial, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_66get_variable_initial},
  {"get_variable_causality", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_69get_variable_causality, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_68get_variable_causality},
  {"get_variable_start", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71get_variable_start, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_70get_variable_start},
  {"get_variable_max", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73get_variable_max, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_72get_variable_max},
  {"get_variable_min", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_75get_variable_min, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_74get_variable_min},
  {"get_fmu_state", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_77get_fmu_state, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_76get_fmu_state},
  {"set_fmu_state", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_79set_fmu_state, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_78set_fmu_state},
  {"free_fmu_state", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_81free_fmu_state, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_80free_fmu_state},
  {"serialize_fmu_state", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_83serialize_fmu_state, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_82serialize_fmu_state},
  {"deserialize_fmu_state", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_85deserialize_fmu_state, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_84deserialize_fmu_state},
  {"serialized_fmu_state_size", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_87serialized_fmu_state_size, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_86serialized_fmu_state_size},
  {"get_ode_sizes", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_89get_ode_sizes, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_88get_ode_sizes},
  {"get_default_experiment_start_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_91get_default_experiment_start_time, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_90get_default_experiment_start_time},
  {"get_default_experiment_stop_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_93get_default_experiment_stop_time, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_92get_default_experiment_stop_time},
  {"get_default_experiment_tolerance", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_95get_default_experiment_tolerance, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_94get_default_experiment_tolerance},
  {"get_default_experiment_step", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_97get_default_experiment_step, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_96get_default_experiment_step},
  {"_convert_filter", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_99_convert_filter, METH_O, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_98_convert_filter},
  {"get_derivatives_list", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_101get_derivatives_list, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_100get_derivatives_list},
  {"get_state_space_representation", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_103get_state_space_representation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_102get_state_space_representation},
  {"get_states_list", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_105get_states_list, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_104get_states_list},
  {"get_input_list", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_107get_input_list, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_106get_input_list},
  {"get_output_list", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_109get_output_list, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_108get_output_list},
  {"get_directional_derivative", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_111get_directional_derivative, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_110get_directional_derivative},
  {"get_version", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_113get_version, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_112get_version},
  {"get_model_version", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_115get_model_version, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_114get_model_version},
  {"get_name", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_117get_name, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_116get_name},
  {"get_author", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_119get_author, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_118get_author},
  {"get_description", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_121get_description, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_120get_description},
  {"get_copyright", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_123get_copyright, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_122get_copyright},
  {"get_license", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_125get_license, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_124get_license},
  {"get_generation_tool", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_127get_generation_tool, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_126get_generation_tool},
  {"get_generation_date_and_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_129get_generation_date_and_time, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_128get_generation_date_and_time},
  {"get_guid", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_131get_guid, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_130get_guid},
  {"get_variable_naming_convention", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_133get_variable_naming_convention, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_132get_variable_naming_convention},
  {"get_identifier", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_135get_identifier, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_134get_identifier},
  {"get_model_types_platform", (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_137get_model_types_platform, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_136get_model_types_platform},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5pyfmi_3fmi_FMUModelBase2[] = {
  {(char *)"_enable_logging", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__enable_logging, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__enable_logging, 0, 0},
  {(char *)"_save_real_variables_val", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_real_variables_val, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__save_real_variables_val, 0, 0},
  {(char *)"_save_int_variables_val", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_int_variables_val, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__save_int_variables_val, 0, 0},
  {(char *)"_save_bool_variables_val", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_bool_variables_val, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__save_bool_variables_val, 0, 0},
  {(char *)"_pyEventInfo", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__pyEventInfo, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__pyEventInfo, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_FMUModelBase2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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 (unlikely(!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) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_5pyfmi_3fmi_11FMUModelCS2_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase2(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelCS2[] = {
  {"_get_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5_get_time, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_4_get_time},
  {"_set_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_7_set_time, METH_O, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_6_set_time},
  {"do_step", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_9do_step, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_8do_step},
  {"cancel_step", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_11cancel_step, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_10cancel_step},
  {"set_input_derivatives", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_13set_input_derivatives, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_12set_input_derivatives},
  {"get_output_derivatives", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_15get_output_derivatives, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_14get_output_derivatives},
  {"get_status", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_17get_status, METH_O, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_16get_status},
  {"get_real_status", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_19get_real_status, METH_O, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_18get_real_status},
  {"get_integer_status", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_21get_integer_status, METH_O, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_20get_integer_status},
  {"get_boolean_status", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_23get_boolean_status, METH_O, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_22get_boolean_status},
  {"get_string_status", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_25get_string_status, METH_O, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_24get_string_status},
  {"simulate", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_27simulate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_26simulate},
  {"simulate_options", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_29simulate_options, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_28simulate_options},
  {"get_capability_flags", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_31get_capability_flags, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_30get_capability_flags},
  {"_provides_directional_derivatives", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_33_provides_directional_derivatives, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_32_provides_directional_derivatives},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_FMUModelCS2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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 (unlikely(!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) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_5pyfmi_3fmi_11FMUModelME2_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase2(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelME2[] = {
  {"_get_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5_get_time, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_4_get_time},
  {"_set_time", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_7_set_time, METH_O, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_6_set_time},
  {"get_event_info", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_9get_event_info, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_8get_event_info},
  {"enter_event_mode", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_11enter_event_mode, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_10enter_event_mode},
  {"enter_continuous_time_mode", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_13enter_continuous_time_mode, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_12enter_continuous_time_mode},
  {"get_event_indicators", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_15get_event_indicators, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_14get_event_indicators},
  {"event_update", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_17event_update, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_16event_update},
  {"get_tolerances", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_19get_tolerances, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_18get_tolerances},
  {"completed_integrator_step", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_21completed_integrator_step, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_20completed_integrator_step},
  {"_get_continuous_states", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_23_get_continuous_states, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_22_get_continuous_states},
  {"_set_continuous_states", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_25_set_continuous_states, METH_O, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_24_set_continuous_states},
  {"_get_nominal_continuous_states", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_27_get_nominal_continuous_states, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_26_get_nominal_continuous_states},
  {"get_derivatives", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_29get_derivatives, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_28get_derivatives},
  {"simulate", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_31simulate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_30simulate},
  {"simulate_options", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_33simulate_options, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_32simulate_options},
  {"get_capability_flags", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_35get_capability_flags, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_34get_capability_flags},
  {"_provides_directional_derivatives", (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_37_provides_directional_derivatives, METH_NOARGS, __pyx_doc_5pyfmi_3fmi_11FMUModelME2_36_provides_directional_derivatives},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_FMUModelME2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #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_FMUModelME1(t, a, k);
  if (unlikely(!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 PyTypeObject __pyx_type_5pyfmi_3fmi_FMUModel = {
  PyVarObject_HEAD_INIT(0, 0)
  "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*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "fmi",
    __pyx_k_Module_containing_the_FMI_inter, /* 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_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
  {&__pyx_n_s_AlgorithmBase, __pyx_k_AlgorithmBase, sizeof(__pyx_k_AlgorithmBase), 0, 0, 1, 1},
  {&__pyx_kp_s_An_FMU_exception, __pyx_k_An_FMU_exception, sizeof(__pyx_k_An_FMU_exception), 0, 0, 1, 0},
  {&__pyx_kp_s_An_error_occured_when_reseting_t, __pyx_k_An_error_occured_when_reseting_t, sizeof(__pyx_k_An_error_occured_when_reseting_t), 0, 0, 1, 0},
  {&__pyx_kp_s_An_error_occured_while_canceling, __pyx_k_An_error_occured_while_canceling, sizeof(__pyx_k_An_error_occured_while_canceling), 0, 0, 1, 0},
  {&__pyx_kp_s_An_error_occured_while_getting_t, __pyx_k_An_error_occured_while_getting_t, sizeof(__pyx_k_An_error_occured_while_getting_t), 0, 0, 1, 0},
  {&__pyx_kp_s_An_error_occured_while_retriving, __pyx_k_An_error_occured_while_retriving, sizeof(__pyx_k_An_error_occured_while_retriving), 0, 0, 1, 0},
  {&__pyx_n_s_AssimuloFMIAlg, __pyx_k_AssimuloFMIAlg, sizeof(__pyx_k_AssimuloFMIAlg), 0, 0, 1, 1},
  {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1},
  {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
  {&__pyx_n_s_CS, __pyx_k_CS, sizeof(__pyx_k_CS), 0, 0, 1, 1},
  {&__pyx_kp_s_C_Development_PyFMI_branches_PyF, __pyx_k_C_Development_PyFMI_branches_PyF, sizeof(__pyx_k_C_Development_PyFMI_branches_PyF), 0, 0, 1, 0},
  {&__pyx_kp_s_Could_not_locate_the_FMU_in_the, __pyx_k_Could_not_locate_the_FMU_in_the, sizeof(__pyx_k_Could_not_locate_the_FMU_in_the), 0, 0, 1, 0},
  {&__pyx_kp_s_Currently_the_logging_of_categor, __pyx_k_Currently_the_logging_of_categor, sizeof(__pyx_k_Currently_the_logging_of_categor), 0, 0, 1, 0},
  {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1},
  {&__pyx_n_s_Default, __pyx_k_Default, sizeof(__pyx_k_Default), 0, 0, 1, 1},
  {&__pyx_kp_s_Either_provide_value_reference_o, __pyx_k_Either_provide_value_reference_o, sizeof(__pyx_k_Either_provide_value_reference_o), 0, 0, 1, 0},
  {&__pyx_kp_s_Enter_Initialize_returned_with_a, __pyx_k_Enter_Initialize_returned_with_a, sizeof(__pyx_k_Enter_Initialize_returned_with_a), 0, 0, 1, 0},
  {&__pyx_kp_s_Enter_Initialize_returned_with_a_2, __pyx_k_Enter_Initialize_returned_with_a_2, sizeof(__pyx_k_Enter_Initialize_returned_with_a_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Enter_Initialize_returned_with_a_3, __pyx_k_Enter_Initialize_returned_with_a_3, sizeof(__pyx_k_Enter_Initialize_returned_with_a_3), 0, 0, 1, 0},
  {&__pyx_kp_s_Enter_Initialize_returned_with_a_4, __pyx_k_Enter_Initialize_returned_with_a_4, sizeof(__pyx_k_Enter_Initialize_returned_with_a_4), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_loading_the_binary, __pyx_k_Error_loading_the_binary, sizeof(__pyx_k_Error_loading_the_binary), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_loading_the_binary_Enable, __pyx_k_Error_loading_the_binary_Enable, sizeof(__pyx_k_Error_loading_the_binary_Enable), 0, 0, 1, 0},
  {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
  {&__pyx_kp_s_Exit_Initialize_returned_with_a, __pyx_k_Exit_Initialize_returned_with_a, sizeof(__pyx_k_Exit_Initialize_returned_with_a), 0, 0, 1, 0},
  {&__pyx_kp_s_Exit_Initialize_returned_with_a_2, __pyx_k_Exit_Initialize_returned_with_a_2, sizeof(__pyx_k_Exit_Initialize_returned_with_a_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Exit_Initialize_returned_with_an, __pyx_k_Exit_Initialize_returned_with_an, sizeof(__pyx_k_Exit_Initialize_returned_with_an), 0, 0, 1, 0},
  {&__pyx_kp_s_Exit_Initialize_returned_with_an_2, __pyx_k_Exit_Initialize_returned_with_an_2, sizeof(__pyx_k_Exit_Initialize_returned_with_an_2), 0, 0, 1, 0},
  {&__pyx_n_s_FMI1_DO_STEP_STATUS, __pyx_k_FMI1_DO_STEP_STATUS, sizeof(__pyx_k_FMI1_DO_STEP_STATUS), 0, 0, 1, 1},
  {&__pyx_n_s_FMI1_LAST_SUCCESSFUL_TIME, __pyx_k_FMI1_LAST_SUCCESSFUL_TIME, sizeof(__pyx_k_FMI1_LAST_SUCCESSFUL_TIME), 0, 0, 1, 1},
  {&__pyx_n_s_FMI1_PENDING_STATUS, __pyx_k_FMI1_PENDING_STATUS, sizeof(__pyx_k_FMI1_PENDING_STATUS), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_BOOLEAN, __pyx_k_FMI2_BOOLEAN, sizeof(__pyx_k_FMI2_BOOLEAN), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_CONSTANT, __pyx_k_FMI2_CONSTANT, sizeof(__pyx_k_FMI2_CONSTANT), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_CONTINUOUS, __pyx_k_FMI2_CONTINUOUS, sizeof(__pyx_k_FMI2_CONTINUOUS), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_DISCRETE, __pyx_k_FMI2_DISCRETE, sizeof(__pyx_k_FMI2_DISCRETE), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_ENUMERATION, __pyx_k_FMI2_ENUMERATION, sizeof(__pyx_k_FMI2_ENUMERATION), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_FALSE, __pyx_k_FMI2_FALSE, sizeof(__pyx_k_FMI2_FALSE), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_FIXED, __pyx_k_FMI2_FIXED, sizeof(__pyx_k_FMI2_FIXED), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_INITIAL_APPROX, __pyx_k_FMI2_INITIAL_APPROX, sizeof(__pyx_k_FMI2_INITIAL_APPROX), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_INITIAL_CALCULATED, __pyx_k_FMI2_INITIAL_CALCULATED, sizeof(__pyx_k_FMI2_INITIAL_CALCULATED), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_INITIAL_EXACT, __pyx_k_FMI2_INITIAL_EXACT, sizeof(__pyx_k_FMI2_INITIAL_EXACT), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_INITIAL_UNKNOWN, __pyx_k_FMI2_INITIAL_UNKNOWN, sizeof(__pyx_k_FMI2_INITIAL_UNKNOWN), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_INPUT, __pyx_k_FMI2_INPUT, sizeof(__pyx_k_FMI2_INPUT), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_INTEGER, __pyx_k_FMI2_INTEGER, sizeof(__pyx_k_FMI2_INTEGER), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_OUTPUT, __pyx_k_FMI2_OUTPUT, sizeof(__pyx_k_FMI2_OUTPUT), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_REAL, __pyx_k_FMI2_REAL, sizeof(__pyx_k_FMI2_REAL), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_STRING, __pyx_k_FMI2_STRING, sizeof(__pyx_k_FMI2_STRING), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_TRUE, __pyx_k_FMI2_TRUE, sizeof(__pyx_k_FMI2_TRUE), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_TUNABLE, __pyx_k_FMI2_TUNABLE, sizeof(__pyx_k_FMI2_TUNABLE), 0, 0, 1, 1},
  {&__pyx_n_s_FMI2_UNKNOWN, __pyx_k_FMI2_UNKNOWN, sizeof(__pyx_k_FMI2_UNKNOWN), 0, 0, 1, 1},
  {&__pyx_n_s_FMICSAlg, __pyx_k_FMICSAlg, sizeof(__pyx_k_FMICSAlg), 0, 0, 1, 1},
  {&__pyx_kp_s_FMIL_module_s_log_level_d_s, __pyx_k_FMIL_module_s_log_level_d_s, sizeof(__pyx_k_FMIL_module_s_log_level_d_s), 0, 0, 1, 0},
  {&__pyx_kp_s_FMIL_module_s_log_lovel_d_s, __pyx_k_FMIL_module_s_log_lovel_d_s, sizeof(__pyx_k_FMIL_module_s_log_lovel_d_s), 0, 0, 1, 0},
  {&__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_DEFAULT_LOG_LEVEL, __pyx_k_FMI_DEFAULT_LOG_LEVEL, sizeof(__pyx_k_FMI_DEFAULT_LOG_LEVEL), 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_MIME_CS_STANDALONE, __pyx_k_FMI_MIME_CS_STANDALONE, sizeof(__pyx_k_FMI_MIME_CS_STANDALONE), 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_REGISTER_GLOBALLY, __pyx_k_FMI_REGISTER_GLOBALLY, sizeof(__pyx_k_FMI_REGISTER_GLOBALLY), 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_kp_s_FMUModelBase2_cannot_be_used_dir, __pyx_k_FMUModelBase2_cannot_be_used_dir, sizeof(__pyx_k_FMUModelBase2_cannot_be_used_dir), 0, 0, 1, 0},
  {&__pyx_kp_s_FMUModel_must_be_instantiated_wi, __pyx_k_FMUModel_must_be_instantiated_wi, sizeof(__pyx_k_FMUModel_must_be_instantiated_wi), 0, 0, 1, 0},
  {&__pyx_kp_s_FMU_fmiStatus_d_s_s_s, __pyx_k_FMU_fmiStatus_d_s_s_s, sizeof(__pyx_k_FMU_fmiStatus_d_s_s_s), 0, 0, 1, 0},
  {&__pyx_kp_s_FMU_is_a, __pyx_k_FMU_is_a, sizeof(__pyx_k_FMU_is_a), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_call_FMI_Completed_Ste, __pyx_k_Failed_to_call_FMI_Completed_Ste, sizeof(__pyx_k_Failed_to_call_FMI_Completed_Ste), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_enter_continuous_time, __pyx_k_Failed_to_enter_continuous_time, sizeof(__pyx_k_Failed_to_enter_continuous_time), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_enter_event_mode, __pyx_k_Failed_to_enter_event_mode, sizeof(__pyx_k_Failed_to_enter_event_mode), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_get_the_Boolean_values, __pyx_k_Failed_to_get_the_Boolean_values, sizeof(__pyx_k_Failed_to_get_the_Boolean_values), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_get_the_Integer_values, __pyx_k_Failed_to_get_the_Integer_values, sizeof(__pyx_k_Failed_to_get_the_Integer_values), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_get_the_Real_output_de, __pyx_k_Failed_to_get_the_Real_output_de, sizeof(__pyx_k_Failed_to_get_the_Real_output_de), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_get_the_Real_values, __pyx_k_Failed_to_get_the_Real_values, sizeof(__pyx_k_Failed_to_get_the_Real_values), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_get_the_continuous_sta, __pyx_k_Failed_to_get_the_continuous_sta, sizeof(__pyx_k_Failed_to_get_the_continuous_sta), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_get_the_derivative_val, __pyx_k_Failed_to_get_the_derivative_val, sizeof(__pyx_k_Failed_to_get_the_derivative_val), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_get_the_event_indicato, __pyx_k_Failed_to_get_the_event_indicato, sizeof(__pyx_k_Failed_to_get_the_event_indicato), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_get_the_nominal_values, __pyx_k_Failed_to_get_the_nominal_values, sizeof(__pyx_k_Failed_to_get_the_nominal_values), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_instantiate_the_model, __pyx_k_Failed_to_instantiate_the_model, sizeof(__pyx_k_Failed_to_instantiate_the_model), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_instantiate_the_slave, __pyx_k_Failed_to_instantiate_the_slave, sizeof(__pyx_k_Failed_to_instantiate_the_slave), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_reset_the_FMU, __pyx_k_Failed_to_reset_the_FMU, sizeof(__pyx_k_Failed_to_reset_the_FMU), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_retrieve_the_continuou, __pyx_k_Failed_to_retrieve_the_continuou, sizeof(__pyx_k_Failed_to_retrieve_the_continuou), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_retrieve_the_last_succ, __pyx_k_Failed_to_retrieve_the_last_succ, sizeof(__pyx_k_Failed_to_retrieve_the_last_succ), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_set_the_Boolean_values, __pyx_k_Failed_to_set_the_Boolean_values, sizeof(__pyx_k_Failed_to_set_the_Boolean_values), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_set_the_Integer_values, __pyx_k_Failed_to_set_the_Integer_values, sizeof(__pyx_k_Failed_to_set_the_Integer_values), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_set_the_Real_input_der, __pyx_k_Failed_to_set_the_Real_input_der, sizeof(__pyx_k_Failed_to_set_the_Real_input_der), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_set_the_Real_values, __pyx_k_Failed_to_set_the_Real_values, sizeof(__pyx_k_Failed_to_set_the_Real_values), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_set_the_debugging_opti, __pyx_k_Failed_to_set_the_debugging_opti, sizeof(__pyx_k_Failed_to_set_the_debugging_opti), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_set_the_debugging_opti_2, __pyx_k_Failed_to_set_the_debugging_opti_2, sizeof(__pyx_k_Failed_to_set_the_debugging_opti_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_set_the_new_continuous, __pyx_k_Failed_to_set_the_new_continuous, sizeof(__pyx_k_Failed_to_set_the_new_continuous), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_set_the_new_continuous_2, __pyx_k_Failed_to_set_the_new_continuous_2, sizeof(__pyx_k_Failed_to_set_the_new_continuous_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_set_the_time, __pyx_k_Failed_to_set_the_time, sizeof(__pyx_k_Failed_to_set_the_time), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_setup_the_experiment, __pyx_k_Failed_to_setup_the_experiment, sizeof(__pyx_k_Failed_to_setup_the_experiment), 0, 0, 1, 0},
  {&__pyx_kp_s_Failed_to_update_the_events_at_t, __pyx_k_Failed_to_update_the_events_at_t, sizeof(__pyx_k_Failed_to_update_the_events_at_t), 0, 0, 1, 0},
  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
  {&__pyx_kp_s_Initialize_returned_with_a_warni, __pyx_k_Initialize_returned_with_a_warni, sizeof(__pyx_k_Initialize_returned_with_a_warni), 0, 0, 1, 0},
  {&__pyx_kp_s_Initialize_returned_with_a_warni_2, __pyx_k_Initialize_returned_with_a_warni_2, sizeof(__pyx_k_Initialize_returned_with_a_warni_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Initialize_returned_with_an_erro, __pyx_k_Initialize_returned_with_an_erro, sizeof(__pyx_k_Initialize_returned_with_an_erro), 0, 0, 1, 0},
  {&__pyx_kp_s_Initialize_returned_with_an_erro_2, __pyx_k_Initialize_returned_with_an_erro_2, sizeof(__pyx_k_Initialize_returned_with_an_erro_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Input_argument_kind_can_only_be, __pyx_k_Input_argument_kind_can_only_be, sizeof(__pyx_k_Input_argument_kind_can_only_be), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_log_level_for_FMI_Librar, __pyx_k_Invalid_log_level_for_FMI_Librar, sizeof(__pyx_k_Invalid_log_level_for_FMI_Librar), 0, 0, 1, 0},
  {&__pyx_kp_s_Logging_is_not_enabled, __pyx_k_Logging_is_not_enabled, sizeof(__pyx_k_Logging_is_not_enabled), 0, 0, 1, 0},
  {&__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_kp_s_Models_that_need_an_execution_to, __pyx_k_Models_that_need_an_execution_to, sizeof(__pyx_k_Models_that_need_an_execution_to), 0, 0, 1, 0},
  {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_kp_s_Not_supported_status_kind, __pyx_k_Not_supported_status_kind, sizeof(__pyx_k_Not_supported_status_kind), 0, 0, 1, 0},
  {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1},
  {&__pyx_kp_s_Property_for_accessing_the_curr, __pyx_k_Property_for_accessing_the_curr, sizeof(__pyx_k_Property_for_accessing_the_curr), 0, 0, 1, 0},
  {&__pyx_kp_s_Property_for_accessing_the_curr_2, __pyx_k_Property_for_accessing_the_curr_2, sizeof(__pyx_k_Property_for_accessing_the_curr_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Property_for_accessing_the_curr_3, __pyx_k_Property_for_accessing_the_curr_3, sizeof(__pyx_k_Property_for_accessing_the_curr_3), 0, 0, 1, 0},
  {&__pyx_kp_s_Property_for_accessing_the_curr_4, __pyx_k_Property_for_accessing_the_curr_4, sizeof(__pyx_k_Property_for_accessing_the_curr_4), 0, 0, 1, 0},
  {&__pyx_kp_s_Property_for_accessing_the_nomi, __pyx_k_Property_for_accessing_the_nomi, sizeof(__pyx_k_Property_for_accessing_the_nomi), 0, 0, 1, 0},
  {&__pyx_kp_s_Property_for_accessing_the_nomi_2, __pyx_k_Property_for_accessing_the_nomi_2, sizeof(__pyx_k_Property_for_accessing_the_nomi_2), 0, 0, 1, 0},
  {&__pyx_n_s_PyEventInfo, __pyx_k_PyEventInfo, sizeof(__pyx_k_PyEventInfo), 0, 0, 1, 1},
  {&__pyx_kp_s_PyFMI_currently_only_supports_FM, __pyx_k_PyFMI_currently_only_supports_FM, sizeof(__pyx_k_PyFMI_currently_only_supports_FM), 0, 0, 1, 0},
  {&__pyx_kp_s_PyFMI_does_not_support_co_simula, __pyx_k_PyFMI_does_not_support_co_simula, sizeof(__pyx_k_PyFMI_does_not_support_co_simula), 0, 0, 1, 0},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_kp_s_Setup_Experiment_has_to_be_calle, __pyx_k_Setup_Experiment_has_to_be_calle, sizeof(__pyx_k_Setup_Experiment_has_to_be_calle), 0, 0, 1, 0},
  {&__pyx_n_s_Slave, __pyx_k_Slave, sizeof(__pyx_k_Slave), 0, 0, 1, 1},
  {&__pyx_kp_s_Status_kind_has_to_be_between_0, __pyx_k_Status_kind_has_to_be_between_0, sizeof(__pyx_k_Status_kind_has_to_be_between_0), 0, 0, 1, 0},
  {&__pyx_n_s_StopTimeDefined, __pyx_k_StopTimeDefined, sizeof(__pyx_k_StopTimeDefined), 0, 0, 1, 1},
  {&__pyx_kp_s_The_DLL_could_not_be_reloaded_ch, __pyx_k_The_DLL_could_not_be_reloaded_ch, sizeof(__pyx_k_The_DLL_could_not_be_reloaded_ch), 0, 0, 1, 0},
  {&__pyx_kp_s_The_FMU_does_not_support_input_d, __pyx_k_The_FMU_does_not_support_input_d, sizeof(__pyx_k_The_FMU_does_not_support_input_d), 0, 0, 1, 0},
  {&__pyx_kp_s_The_FMU_kind_could_not_be_determ, __pyx_k_The_FMU_kind_could_not_be_determ, sizeof(__pyx_k_The_FMU_kind_could_not_be_determ), 0, 0, 1, 0},
  {&__pyx_kp_s_The_FMU_kind_could_not_be_determ_2, __pyx_k_The_FMU_kind_could_not_be_determ_2, sizeof(__pyx_k_The_FMU_kind_could_not_be_determ_2), 0, 0, 1, 0},
  {&__pyx_kp_s_The_FMU_version_could_not_be_det, __pyx_k_The_FMU_version_could_not_be_det, sizeof(__pyx_k_The_FMU_version_could_not_be_det), 0, 0, 1, 0},
  {&__pyx_kp_s_The_FMU_version_could_not_be_det_2, __pyx_k_The_FMU_version_could_not_be_det_2, sizeof(__pyx_k_The_FMU_version_could_not_be_det_2), 0, 0, 1, 0},
  {&__pyx_kp_s_The_FMU_version_is_not_found, __pyx_k_The_FMU_version_is_not_found, sizeof(__pyx_k_The_FMU_version_is_not_found), 0, 0, 1, 0},
  {&__pyx_kp_s_The_FMU_version_is_not_found_Ena, __pyx_k_The_FMU_version_is_not_found_Ena, sizeof(__pyx_k_The_FMU_version_is_not_found_Ena), 0, 0, 1, 0},
  {&__pyx_kp_s_The_FMU_version_is_not_supported, __pyx_k_The_FMU_version_is_not_supported, sizeof(__pyx_k_The_FMU_version_is_not_supported), 0, 0, 1, 0},
  {&__pyx_kp_s_The_FMU_version_is_not_supported_2, __pyx_k_The_FMU_version_is_not_supported_2, sizeof(__pyx_k_The_FMU_version_is_not_supported_2), 0, 0, 1, 0},
  {&__pyx_kp_s_The_FMU_version_is_unsupported, __pyx_k_The_FMU_version_is_unsupported, sizeof(__pyx_k_The_FMU_version_is_unsupported), 0, 0, 1, 0},
  {&__pyx_kp_s_The_FMU_version_is_unsupported_E, __pyx_k_The_FMU_version_is_unsupported_E, sizeof(__pyx_k_The_FMU_version_is_unsupported_E), 0, 0, 1, 0},
  {&__pyx_kp_s_The_XML_could_not_be_read, __pyx_k_The_XML_could_not_be_read, sizeof(__pyx_k_The_XML_could_not_be_read), 0, 0, 1, 0},
  {&__pyx_kp_s_The_XML_could_not_be_read_Enable, __pyx_k_The_XML_could_not_be_read_Enable, sizeof(__pyx_k_The_XML_could_not_be_read_Enable), 0, 0, 1, 0},
  {&__pyx_kp_s_The_XML_file_could_not_be_parsed, __pyx_k_The_XML_file_could_not_be_parsed, sizeof(__pyx_k_The_XML_file_could_not_be_parsed), 0, 0, 1, 0},
  {&__pyx_kp_s_The_XML_file_could_not_be_parsed_2, __pyx_k_The_XML_file_could_not_be_parsed_2, sizeof(__pyx_k_The_XML_file_could_not_be_parsed_2), 0, 0, 1, 0},
  {&__pyx_kp_s_The_attribute_enable_logging_is, __pyx_k_The_attribute_enable_logging_is, sizeof(__pyx_k_The_attribute_enable_logging_is), 0, 0, 1, 0},
  {&__pyx_kp_s_The_instance_is_not_curent_an_in, __pyx_k_The_instance_is_not_curent_an_in, sizeof(__pyx_k_The_instance_is_not_curent_an_in), 0, 0, 1, 0},
  {&__pyx_kp_s_The_length_of_the_list_with_vari, __pyx_k_The_length_of_the_list_with_vari, sizeof(__pyx_k_The_length_of_the_list_with_vari), 0, 0, 1, 0},
  {&__pyx_kp_s_The_length_of_valueref_and_value, __pyx_k_The_length_of_valueref_and_value, sizeof(__pyx_k_The_length_of_valueref_and_value), 0, 0, 1, 0},
  {&__pyx_kp_s_The_log_level_must_be_between_d, __pyx_k_The_log_level_must_be_between_d, sizeof(__pyx_k_The_log_level_must_be_between_d), 0, 0, 1, 0},
  {&__pyx_kp_s_The_method_set_fmil_log_level_is, __pyx_k_The_method_set_fmil_log_level_is, sizeof(__pyx_k_The_method_set_fmil_log_level_is), 0, 0, 1, 0},
  {&__pyx_kp_s_The_number_of_variables_must_be, __pyx_k_The_number_of_variables_must_be, sizeof(__pyx_k_The_number_of_variables_must_be), 0, 0, 1, 0},
  {&__pyx_kp_s_The_order_must_be_greater_than_z, __pyx_k_The_order_must_be_greater_than_z, sizeof(__pyx_k_The_order_must_be_greater_than_z), 0, 0, 1, 0},
  {&__pyx_kp_s_The_order_must_be_greater_than_z_2, __pyx_k_The_order_must_be_greater_than_z_2, sizeof(__pyx_k_The_order_must_be_greater_than_z_2), 0, 0, 1, 0},
  {&__pyx_kp_s_The_returned_derivatives_states, __pyx_k_The_returned_derivatives_states, sizeof(__pyx_k_The_returned_derivatives_states), 0, 0, 1, 0},
  {&__pyx_kp_s_The_returned_states_list_is_NULL, __pyx_k_The_returned_states_list_is_NULL, sizeof(__pyx_k_The_returned_states_list_is_NULL), 0, 0, 1, 0},
  {&__pyx_kp_s_The_slave_failed_to_initialize_S, __pyx_k_The_slave_failed_to_initialize_S, sizeof(__pyx_k_The_slave_failed_to_initialize_S), 0, 0, 1, 0},
  {&__pyx_kp_s_The_variable_is_not_a_real_varia, __pyx_k_The_variable_is_not_a_real_varia, sizeof(__pyx_k_The_variable_is_not_a_real_varia), 0, 0, 1, 0},
  {&__pyx_kp_s_The_variable_s_could_not_be_foun, __pyx_k_The_variable_s_could_not_be_foun, sizeof(__pyx_k_The_variable_s_could_not_be_foun), 0, 0, 1, 0},
  {&__pyx_kp_s_The_variable_s_does_not_have_a_s, __pyx_k_The_variable_s_does_not_have_a_s, sizeof(__pyx_k_The_variable_s_does_not_have_a_s), 0, 0, 1, 0},
  {&__pyx_kp_s_The_variable_type_does_not_have, __pyx_k_The_variable_type_does_not_have, sizeof(__pyx_k_The_variable_type_does_not_have), 0, 0, 1, 0},
  {&__pyx_kp_s_The_variable_type_does_not_have_2, __pyx_k_The_variable_type_does_not_have_2, sizeof(__pyx_k_The_variable_type_does_not_have_2), 0, 0, 1, 0},
  {&__pyx_kp_s_The_variable_with_the_valuref_i, __pyx_k_The_variable_with_the_valuref_i, sizeof(__pyx_k_The_variable_with_the_valuref_i), 0, 0, 1, 0},
  {&__pyx_kp_s_The_variable_with_value_referenc, __pyx_k_The_variable_with_value_referenc, sizeof(__pyx_k_The_variable_with_value_referenc), 0, 0, 1, 0},
  {&__pyx_kp_s_The_variables_must_either_be_a_s, __pyx_k_The_variables_must_either_be_a_s, sizeof(__pyx_k_The_variables_must_either_be_a_s), 0, 0, 1, 0},
  {&__pyx_kp_s_This_FMU_does_not_provide_direct, __pyx_k_This_FMU_does_not_provide_direct, sizeof(__pyx_k_This_FMU_does_not_provide_direct), 0, 0, 1, 0},
  {&__pyx_kp_s_This_class_only_supports_FMI_1_0, __pyx_k_This_class_only_supports_FMI_1_0, sizeof(__pyx_k_This_class_only_supports_FMI_1_0), 0, 0, 1, 0},
  {&__pyx_kp_s_This_class_only_supports_FMI_1_0_2, __pyx_k_This_class_only_supports_FMI_1_0_2, sizeof(__pyx_k_This_class_only_supports_FMI_1_0_2), 0, 0, 1, 0},
  {&__pyx_kp_s_This_class_only_supports_FMI_1_0_3, __pyx_k_This_class_only_supports_FMI_1_0_3, sizeof(__pyx_k_This_class_only_supports_FMI_1_0_3), 0, 0, 1, 0},
  {&__pyx_kp_s_This_class_only_supports_FMI_2_0, __pyx_k_This_class_only_supports_FMI_2_0, sizeof(__pyx_k_This_class_only_supports_FMI_2_0), 0, 0, 1, 0},
  {&__pyx_kp_s_This_class_only_supports_FMI_2_0_2, __pyx_k_This_class_only_supports_FMI_2_0_2, sizeof(__pyx_k_This_class_only_supports_FMI_2_0_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Type_not_supported, __pyx_k_Type_not_supported, sizeof(__pyx_k_Type_not_supported), 0, 0, 1, 0},
  {&__pyx_kp_s_Unknown_input, __pyx_k_Unknown_input, sizeof(__pyx_k_Unknown_input), 0, 0, 1, 0},
  {&__pyx_kp_s_Unknown_variable_type, __pyx_k_Unknown_variable_type, sizeof(__pyx_k_Unknown_variable_type), 0, 0, 1, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_s_WARNING_This_class_is_deprecated, __pyx_k_WARNING_This_class_is_deprecated, sizeof(__pyx_k_WARNING_This_class_is_deprecated), 0, 0, 1, 0},
  {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0},
  {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
  {&__pyx_kp_s__207, __pyx_k__207, sizeof(__pyx_k__207), 0, 0, 1, 0},
  {&__pyx_kp_s__208, __pyx_k__208, sizeof(__pyx_k__208), 0, 0, 1, 0},
  {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0},
  {&__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_kp_s_and_not_a, __pyx_k_and_not_a, sizeof(__pyx_k_and_not_a), 0, 0, 1, 0},
  {&__pyx_kp_s_application_x_fmu_sharedlibrary, __pyx_k_application_x_fmu_sharedlibrary, sizeof(__pyx_k_application_x_fmu_sharedlibrary), 0, 0, 1, 0},
  {&__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_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_canBeInstantiatedOnlyOncePerProc, __pyx_k_canBeInstantiatedOnlyOncePerProc, sizeof(__pyx_k_canBeInstantiatedOnlyOncePerProc), 0, 0, 1, 1},
  {&__pyx_n_s_canGetAndSetFMUstate, __pyx_k_canGetAndSetFMUstate, sizeof(__pyx_k_canGetAndSetFMUstate), 0, 0, 1, 1},
  {&__pyx_n_s_canHandleEvents, __pyx_k_canHandleEvents, sizeof(__pyx_k_canHandleEvents), 0, 0, 1, 1},
  {&__pyx_n_s_canHandleVariableCommunicationSt, __pyx_k_canHandleVariableCommunicationSt, sizeof(__pyx_k_canHandleVariableCommunicationSt), 0, 0, 1, 1},
  {&__pyx_n_s_canInterpolateInputs, __pyx_k_canInterpolateInputs, sizeof(__pyx_k_canInterpolateInputs), 0, 0, 1, 1},
  {&__pyx_n_s_canNotUseMemoryManagementFunctio, __pyx_k_canNotUseMemoryManagementFunctio, sizeof(__pyx_k_canNotUseMemoryManagementFunctio), 0, 0, 1, 1},
  {&__pyx_n_s_canRejectSteps, __pyx_k_canRejectSteps, sizeof(__pyx_k_canRejectSteps), 0, 0, 1, 1},
  {&__pyx_n_s_canRunAsynchronuously, __pyx_k_canRunAsynchronuously, sizeof(__pyx_k_canRunAsynchronuously), 0, 0, 1, 1},
  {&__pyx_n_s_canSerializeFMUstate, __pyx_k_canSerializeFMUstate, sizeof(__pyx_k_canSerializeFMUstate), 0, 0, 1, 1},
  {&__pyx_n_s_canSignalEvents, __pyx_k_canSignalEvents, sizeof(__pyx_k_canSignalEvents), 0, 0, 1, 1},
  {&__pyx_n_s_categories, __pyx_k_categories, sizeof(__pyx_k_categories), 0, 0, 1, 1},
  {&__pyx_n_s_causality, __pyx_k_causality, sizeof(__pyx_k_causality), 0, 0, 1, 1},
  {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1},
  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
  {&__pyx_kp_s_common_algorithm_drivers, __pyx_k_common_algorithm_drivers, sizeof(__pyx_k_common_algorithm_drivers), 0, 0, 1, 0},
  {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
  {&__pyx_n_s_completedEventIterationIsProvide, __pyx_k_completedEventIterationIsProvide, sizeof(__pyx_k_completedEventIterationIsProvide), 0, 0, 1, 1},
  {&__pyx_n_s_completedIntegratorStepNotNeeded, __pyx_k_completedIntegratorStepNotNeeded, sizeof(__pyx_k_completedIntegratorStepNotNeeded), 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_convert_filter, __pyx_k_convert_filter, sizeof(__pyx_k_convert_filter), 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_current_t, __pyx_k_current_t, sizeof(__pyx_k_current_t), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_default_options, __pyx_k_default_options, sizeof(__pyx_k_default_options), 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_deserialize_fmu_state, __pyx_k_deserialize_fmu_state, sizeof(__pyx_k_deserialize_fmu_state), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_doc_2, __pyx_k_doc_2, sizeof(__pyx_k_doc_2), 0, 0, 1, 1},
  {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
  {&__pyx_n_s_enable_logging, __pyx_k_enable_logging, sizeof(__pyx_k_enable_logging), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_exec_simulate_algorithm, __pyx_k_exec_simulate_algorithm, sizeof(__pyx_k_exec_simulate_algorithm), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_fget, __pyx_k_fget, sizeof(__pyx_k_fget), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_filter, __pyx_k_filter, sizeof(__pyx_k_filter), 0, 0, 1, 1},
  {&__pyx_n_s_final_time, __pyx_k_final_time, sizeof(__pyx_k_final_time), 0, 0, 1, 1},
  {&__pyx_n_s_flat, __pyx_k_flat, sizeof(__pyx_k_flat), 0, 0, 1, 1},
  {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1},
  {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
  {&__pyx_n_s_fmu, __pyx_k_fmu, sizeof(__pyx_k_fmu), 0, 0, 1, 1},
  {&__pyx_n_s_fmu_1, __pyx_k_fmu_1, sizeof(__pyx_k_fmu_1), 0, 0, 1, 1},
  {&__pyx_n_s_fmu_1_kind, __pyx_k_fmu_1_kind, sizeof(__pyx_k_fmu_1_kind), 0, 0, 1, 1},
  {&__pyx_kp_s_fmu_2, __pyx_k_fmu_2, sizeof(__pyx_k_fmu_2), 0, 0, 1, 0},
  {&__pyx_n_s_fmu_2_2, __pyx_k_fmu_2_2, sizeof(__pyx_k_fmu_2_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_3, __pyx_k_fmu_3, sizeof(__pyx_k_fmu_3), 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, __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_boolean, __pyx_k_get_boolean, sizeof(__pyx_k_get_boolean), 0, 0, 1, 1},
  {&__pyx_n_s_get_capability_flags, __pyx_k_get_capability_flags, sizeof(__pyx_k_get_capability_flags), 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_continuous_states, __pyx_k_get_continuous_states, sizeof(__pyx_k_get_continuous_states), 0, 0, 1, 1},
  {&__pyx_n_s_get_default_experiment_start_tim, __pyx_k_get_default_experiment_start_tim, sizeof(__pyx_k_get_default_experiment_start_tim), 0, 0, 1, 1},
  {&__pyx_n_s_get_default_experiment_stop_time, __pyx_k_get_default_experiment_stop_time, sizeof(__pyx_k_get_default_experiment_stop_time), 0, 0, 1, 1},
  {&__pyx_n_s_get_default_experiment_tolerance, __pyx_k_get_default_experiment_tolerance, sizeof(__pyx_k_get_default_experiment_tolerance), 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_derivatives_list, __pyx_k_get_derivatives_list, sizeof(__pyx_k_get_derivatives_list), 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_directional_derivative, __pyx_k_get_directional_derivative, sizeof(__pyx_k_get_directional_derivative), 0, 0, 1, 1},
  {&__pyx_n_s_get_initial, __pyx_k_get_initial, sizeof(__pyx_k_get_initial), 0, 0, 1, 1},
  {&__pyx_n_s_get_input_list, __pyx_k_get_input_list, sizeof(__pyx_k_get_input_list), 0, 0, 1, 1},
  {&__pyx_n_s_get_integer, __pyx_k_get_integer, sizeof(__pyx_k_get_integer), 0, 0, 1, 1},
  {&__pyx_n_s_get_log, __pyx_k_get_log, sizeof(__pyx_k_get_log), 0, 0, 1, 1},
  {&__pyx_n_s_get_model_types_platform, __pyx_k_get_model_types_platform, sizeof(__pyx_k_get_model_types_platform), 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_name, __pyx_k_get_name, sizeof(__pyx_k_get_name), 0, 0, 1, 1},
  {&__pyx_n_s_get_nominal_continuous_states, __pyx_k_get_nominal_continuous_states, sizeof(__pyx_k_get_nominal_continuous_states), 0, 0, 1, 1},
  {&__pyx_n_s_get_output_list, __pyx_k_get_output_list, sizeof(__pyx_k_get_output_list), 0, 0, 1, 1},
  {&__pyx_n_s_get_real, __pyx_k_get_real, sizeof(__pyx_k_get_real), 0, 0, 1, 1},
  {&__pyx_n_s_get_result, __pyx_k_get_result, sizeof(__pyx_k_get_result), 0, 0, 1, 1},
  {&__pyx_n_s_get_states_list, __pyx_k_get_states_list, sizeof(__pyx_k_get_states_list), 0, 0, 1, 1},
  {&__pyx_n_s_get_string, __pyx_k_get_string, sizeof(__pyx_k_get_string), 0, 0, 1, 1},
  {&__pyx_n_s_get_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_value_reference, __pyx_k_get_value_reference, sizeof(__pyx_k_get_value_reference), 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_variable_causality, __pyx_k_get_variable_causality, sizeof(__pyx_k_get_variable_causality), 0, 0, 1, 1},
  {&__pyx_n_s_get_variable_data_type, __pyx_k_get_variable_data_type, sizeof(__pyx_k_get_variable_data_type), 0, 0, 1, 1},
  {&__pyx_n_s_get_variable_description, __pyx_k_get_variable_description, sizeof(__pyx_k_get_variable_description), 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_initial, __pyx_k_get_variable_initial, sizeof(__pyx_k_get_variable_initial), 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_get_variable_valueref, __pyx_k_get_variable_valueref, sizeof(__pyx_k_get_variable_valueref), 0, 0, 1, 1},
  {&__pyx_n_s_get_variable_variability, __pyx_k_get_variable_variability, sizeof(__pyx_k_get_variable_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_handle_load_fmu_exception, __pyx_k_handle_load_fmu_exception, sizeof(__pyx_k_handle_load_fmu_exception), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 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_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_initial, __pyx_k_initial, sizeof(__pyx_k_initial), 0, 0, 1, 1},
  {&__pyx_n_s_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 0, 1, 1},
  {&__pyx_n_s_instantiate, __pyx_k_instantiate, sizeof(__pyx_k_instantiate), 0, 0, 1, 1},
  {&__pyx_n_s_instantiate_model, __pyx_k_instantiate_model, sizeof(__pyx_k_instantiate_model), 0, 0, 1, 1},
  {&__pyx_n_s_instantiate_slave, __pyx_k_instantiate_slave, sizeof(__pyx_k_instantiate_slave), 0, 0, 1, 1},
  {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_n_s_intermediateResult, __pyx_k_intermediateResult, sizeof(__pyx_k_intermediateResult), 0, 0, 1, 1},
  {&__pyx_n_s_internal_set_fmu_null, __pyx_k_internal_set_fmu_null, sizeof(__pyx_k_internal_set_fmu_null), 0, 0, 1, 1},
  {&__pyx_n_s_isfile, __pyx_k_isfile, sizeof(__pyx_k_isfile), 0, 0, 1, 1},
  {&__pyx_n_s_iterationConverged, __pyx_k_iterationConverged, sizeof(__pyx_k_iterationConverged), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
  {&__pyx_n_s_last_error, __pyx_k_last_error, sizeof(__pyx_k_last_error), 0, 0, 1, 1},
  {&__pyx_n_s_latin_1_encode, __pyx_k_latin_1_encode, sizeof(__pyx_k_latin_1_encode), 0, 0, 1, 1},
  {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1},
  {&__pyx_n_s_load_fmu, __pyx_k_load_fmu, sizeof(__pyx_k_load_fmu), 0, 0, 1, 1},
  {&__pyx_n_s_load_fmu_deprecated, __pyx_k_load_fmu_deprecated, sizeof(__pyx_k_load_fmu_deprecated), 0, 0, 1, 1},
  {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1},
  {&__pyx_n_s_log_file, __pyx_k_log_file, sizeof(__pyx_k_log_file), 0, 0, 1, 1},
  {&__pyx_n_s_log_file_c, __pyx_k_log_file_c, sizeof(__pyx_k_log_file_c), 0, 0, 1, 1},
  {&__pyx_n_s_log_file_name, __pyx_k_log_file_name, sizeof(__pyx_k_log_file_name), 0, 0, 1, 1},
  {&__pyx_n_s_log_level, __pyx_k_log_level, sizeof(__pyx_k_log_level), 0, 0, 1, 1},
  {&__pyx_kp_s_log_txt, __pyx_k_log_txt, sizeof(__pyx_k_log_txt), 0, 0, 1, 0},
  {&__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_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1},
  {&__pyx_n_s_maxOutputDerivativeOrder, __pyx_k_maxOutputDerivativeOrder, sizeof(__pyx_k_maxOutputDerivativeOrder), 0, 0, 1, 1},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_model, __pyx_k_model, sizeof(__pyx_k_model), 0, 0, 1, 1},
  {&__pyx_n_s_model_types_platform, __pyx_k_model_types_platform, sizeof(__pyx_k_model_types_platform), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_module_2, __pyx_k_module_2, sizeof(__pyx_k_module_2), 0, 0, 1, 1},
  {&__pyx_kp_s_must_be_a_subclass_of_common_al, __pyx_k_must_be_a_subclass_of_common_al, sizeof(__pyx_k_must_be_a_subclass_of_common_al), 0, 0, 1, 0},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
  {&__pyx_n_s_ndmin, __pyx_k_ndmin, sizeof(__pyx_k_ndmin), 0, 0, 1, 1},
  {&__pyx_n_s_needsExecutionTool, __pyx_k_needsExecutionTool, sizeof(__pyx_k_needsExecutionTool), 0, 0, 1, 1},
  {&__pyx_n_s_newDiscreteStatesNeeded, __pyx_k_newDiscreteStatesNeeded, sizeof(__pyx_k_newDiscreteStatesNeeded), 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_nextEventTimeDefined, __pyx_k_nextEventTimeDefined, sizeof(__pyx_k_nextEventTimeDefined), 0, 0, 1, 1},
  {&__pyx_n_s_no_set_FMU_state_prior_to_curren, __pyx_k_no_set_FMU_state_prior_to_curren, sizeof(__pyx_k_no_set_FMU_state_prior_to_curren), 0, 0, 1, 1},
  {&__pyx_n_s_nominal_continuous_states, __pyx_k_nominal_continuous_states, sizeof(__pyx_k_nominal_continuous_states), 0, 0, 1, 1},
  {&__pyx_n_s_nominalsOfContinuousStatesChange, __pyx_k_nominalsOfContinuousStatesChange, sizeof(__pyx_k_nominalsOfContinuousStatesChange), 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_original_enable_logging, __pyx_k_original_enable_logging, sizeof(__pyx_k_original_enable_logging), 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_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 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_providesDirectionalDerivatives, __pyx_k_providesDirectionalDerivatives, sizeof(__pyx_k_providesDirectionalDerivatives), 0, 0, 1, 1},
  {&__pyx_n_s_provides_directional_derivative, __pyx_k_provides_directional_derivative, sizeof(__pyx_k_provides_directional_derivative), 0, 0, 1, 1},
  {&__pyx_n_s_pyfmi_common, __pyx_k_pyfmi_common, sizeof(__pyx_k_pyfmi_common), 0, 0, 1, 1},
  {&__pyx_n_s_pyfmi_common_core, __pyx_k_pyfmi_common_core, sizeof(__pyx_k_pyfmi_common_core), 0, 0, 1, 1},
  {&__pyx_n_s_pyfmi_fmi, __pyx_k_pyfmi_fmi, sizeof(__pyx_k_pyfmi_fmi), 0, 0, 1, 1},
  {&__pyx_kp_s_pyfmi_fmi_algorithm_drivers, __pyx_k_pyfmi_fmi_algorithm_drivers, sizeof(__pyx_k_pyfmi_fmi_algorithm_drivers), 0, 0, 1, 0},
  {&__pyx_n_s_python3_flag, __pyx_k_python3_flag, sizeof(__pyx_k_python3_flag), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
  {&__pyx_n_s_readline, __pyx_k_readline, sizeof(__pyx_k_readline), 0, 0, 1, 1},
  {&__pyx_n_s_relativeTolerance, __pyx_k_relativeTolerance, sizeof(__pyx_k_relativeTolerance), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_serialize_fmu_state, __pyx_k_serialize_fmu_state, sizeof(__pyx_k_serialize_fmu_state), 0, 0, 1, 1},
  {&__pyx_n_s_serialized_fmu_state_size, __pyx_k_serialized_fmu_state_size, sizeof(__pyx_k_serialized_fmu_state_size), 0, 0, 1, 1},
  {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 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_continuous_states, __pyx_k_set_continuous_states, sizeof(__pyx_k_set_continuous_states), 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_set_time, __pyx_k_set_time, sizeof(__pyx_k_set_time), 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_start_time, __pyx_k_start_time, sizeof(__pyx_k_start_time), 0, 0, 1, 1},
  {&__pyx_n_s_stateValueReferencesChanged, __pyx_k_stateValueReferencesChanged, sizeof(__pyx_k_stateValueReferencesChanged), 0, 0, 1, 1},
  {&__pyx_n_s_stateValuesChanged, __pyx_k_stateValuesChanged, sizeof(__pyx_k_stateValuesChanged), 0, 0, 1, 1},
  {&__pyx_n_s_step_size, __pyx_k_step_size, sizeof(__pyx_k_step_size), 0, 0, 1, 1},
  {&__pyx_n_s_stop_time, __pyx_k_stop_time, sizeof(__pyx_k_stop_time), 0, 0, 1, 1},
  {&__pyx_n_s_stop_time_defined, __pyx_k_stop_time_defined, sizeof(__pyx_k_stop_time_defined), 0, 0, 1, 1},
  {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
  {&__pyx_n_s_structured, __pyx_k_structured, sizeof(__pyx_k_structured), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_tStart, __pyx_k_tStart, sizeof(__pyx_k_tStart), 0, 0, 1, 1},
  {&__pyx_n_s_tStop, __pyx_k_tStop, sizeof(__pyx_k_tStop), 0, 0, 1, 1},
  {&__pyx_n_s_terminateSimulation, __pyx_k_terminateSimulation, sizeof(__pyx_k_terminateSimulation), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_tolControlled, __pyx_k_tolControlled, sizeof(__pyx_k_tolControlled), 0, 0, 1, 1},
  {&__pyx_n_s_tolerance, __pyx_k_tolerance, sizeof(__pyx_k_tolerance), 0, 0, 1, 1},
  {&__pyx_n_s_tolerance_defined, __pyx_k_tolerance_defined, sizeof(__pyx_k_tolerance_defined), 0, 0, 1, 1},
  {&__pyx_n_s_translate, __pyx_k_translate, sizeof(__pyx_k_translate), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_types_platform, __pyx_k_types_platform, sizeof(__pyx_k_types_platform), 0, 0, 1, 1},
  {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1},
  {&__pyx_n_s_unknown, __pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 0, 1, 1},
  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
  {&__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_valuesOfContinuousStatesChanged, __pyx_k_valuesOfContinuousStatesChanged, sizeof(__pyx_k_valuesOfContinuousStatesChanged), 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_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "pyfmi\fmi.pyx":159
 * #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_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "pyfmi\fmi.pyx":580
 *                 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_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_The_attribute_enable_logging_is); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "pyfmi\fmi.pyx":589
 * 
 *         # 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_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_fmu_2); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "pyfmi\fmi.pyx":590
 *         # 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_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_FMUModel_must_be_instantiated_wi); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "pyfmi\fmi.pyx":611
 *                 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_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_The_FMU_version_could_not_be_det_2); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "pyfmi\fmi.pyx":613
 *                 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_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_This_class_only_supports_FMI_1_0); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "pyfmi\fmi.pyx":622
 *                 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_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_The_XML_file_could_not_be_parsed_2); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "pyfmi\fmi.pyx":628
 *         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_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_This_class_only_supports_FMI_1_0); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "pyfmi\fmi.pyx":639
 *                 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_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Error_loading_the_binary_Enable); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "pyfmi\fmi.pyx":662
 * 
 *         #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_tuple__20 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "pyfmi\fmi.pyx":670
 *     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_tuple__21 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "pyfmi\fmi.pyx":677
 *     def append_log_message(self, module, log_level, message):
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:             # <<<<<<<<<<<<<<
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 */
  __pyx_tuple__22 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "pyfmi\fmi.pyx":702
 *                     if line == "":
 *                         break
 *                     log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 *         return log
 * 
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s__23); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "pyfmi\fmi.pyx":697
 *         log = []
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     line = file.readline()
 */
  __pyx_tuple__25 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "pyfmi\fmi.pyx":738
 *                 regexp.append(re.compile(regex))
 *         else:
 *             raise FMUException("Unknown input.")             # <<<<<<<<<<<<<<
 *         return regexp
 * 
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unknown_input); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "pyfmi\fmi.pyx":808
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_Real_values); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "pyfmi\fmi.pyx":837
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_The_length_of_valueref_and_value); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "pyfmi\fmi.pyx":843
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_Real_values); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "pyfmi\fmi.pyx":875
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_Integer_values); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "pyfmi\fmi.pyx":905
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_The_length_of_valueref_and_value); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "pyfmi\fmi.pyx":911
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_Integer_values); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "pyfmi\fmi.pyx":957
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         return N.array(return_values)
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_Boolean_values); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "pyfmi\fmi.pyx":999
 * 
 *         if val_ref.size != values.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_The_length_of_valueref_and_value); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "pyfmi\fmi.pyx":1008
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_Boolean_values); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "pyfmi\fmi.pyx":1116
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def set_log_level(self, FMIL.jm_log_level_enu_t level):
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_debugging_opti); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "pyfmi\fmi.pyx":1138
 *         """
 *         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_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Invalid_log_level_for_FMI_Librar); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "pyfmi\fmi.pyx":1142
 * 
 *     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_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_The_method_set_fmil_log_level_is); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "pyfmi\fmi.pyx":1180
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Type_not_supported); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "pyfmi\fmi.pyx":1215
 *             return not value if alias_kind == FMI_NEGATED_ALIAS else value
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_description(self, variable_name):
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_Type_not_supported); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "pyfmi\fmi.pyx":1325
 *                 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_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Either_provide_value_reference_o); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "pyfmi\fmi.pyx":1329
 *         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_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_The_variable_is_not_a_real_varia); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "pyfmi\fmi.pyx":1426
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self, variable_name):
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Unknown_variable_type); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "pyfmi\fmi.pyx":1469
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self, variable_name):
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_The_variable_type_does_not_have); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "pyfmi\fmi.pyx":1512
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_The_variable_type_does_not_have_2); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "pyfmi\fmi.pyx":1951
 * 
 *         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_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_This_class_only_supports_FMI_1_0_2); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "pyfmi\fmi.pyx":2079
 *                 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_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_The_variables_must_either_be_a_s); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "pyfmi\fmi.pyx":2086
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_Real_output_de); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "pyfmi\fmi.pyx":2118
 * 
 *             if status != 0:
 *                 raise FMUException('Failed to retrieve the last successful time. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *             return value
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_retrieve_the_last_succ); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "pyfmi\fmi.pyx":2122
 *             return value
 *         else:
 *             raise FMUException('Not supported status kind.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Not_supported_status_kind); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "pyfmi\fmi.pyx":2151
 * 
 *         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_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_The_number_of_variables_must_be); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "pyfmi\fmi.pyx":2159
 *         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_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_The_order_must_be_greater_than_z_2); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "pyfmi\fmi.pyx":2161
 *                 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_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_The_FMU_does_not_support_input_d); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "pyfmi\fmi.pyx":2171
 *                 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_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_The_variables_must_either_be_a_s); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "pyfmi\fmi.pyx":2176
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_Real_input_der); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "pyfmi\fmi.pyx":2292
 * 
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("The slave failed to initialize. See the log for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *         self._allocated_fmu = 1
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_The_slave_failed_to_initialize_S); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "pyfmi\fmi.pyx":2304
 *         status = FMIL.fmi1_import_reset_slave(self._fmu)
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("Failed to reset the FMU.")             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_reset_the_FMU); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "pyfmi\fmi.pyx":2344
 * 
 *         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_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_instantiate_the_slave); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "pyfmi\fmi.pyx":2351
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def get_capability_flags(self):
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_debugging_opti_2); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "pyfmi\fmi.pyx":2396
 * 
 *         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_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_This_class_only_supports_FMI_1_0_3); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "pyfmi\fmi.pyx":2434
 *         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_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_The_DLL_could_not_be_reloaded_ch); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "pyfmi\fmi.pyx":2485
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 * 
 *     time = property(_get_time,_set_time, doc =
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_time); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "pyfmi\fmi.pyx":2499
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_retrieve_the_continuou); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "pyfmi\fmi.pyx":2508
 * 
 *         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_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_new_continuous); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "pyfmi\fmi.pyx":2516
 * 
 *         if status >= 3:
 *             raise FMUException('Failed to set the new continuous states.')             # <<<<<<<<<<<<<<
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_new_continuous_2); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "pyfmi\fmi.pyx":2533
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_nominal_values); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "pyfmi\fmi.pyx":2589
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_event_indicato); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "pyfmi\fmi.pyx":2716
 * 
 *         if status != 0:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to get the continuous state reference values.')
 * 
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_continuous_sta); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "pyfmi\fmi.pyx":2740
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         if callEventUpdate == 1:
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_call_FMI_Completed_Ste); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "pyfmi\fmi.pyx":2787
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_Initialize_returned_with_a_warni); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "pyfmi\fmi.pyx":2791
 *                     ' 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_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_Initialize_returned_with_a_warni_2); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "pyfmi\fmi.pyx":2796
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with an error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_Initialize_returned_with_an_erro); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "pyfmi\fmi.pyx":2800
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Initialize returned with an error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_Initialize_returned_with_an_erro_2); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "pyfmi\fmi.pyx":2834
 * 
 *         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_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_instantiate_the_model); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "pyfmi\fmi.pyx":2841
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_debugging_opti_2); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "pyfmi\fmi.pyx":3040
 *                 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_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_The_attribute_enable_logging_is); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "pyfmi\fmi.pyx":3044
 * 
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu.endswith('.fmu'):             # <<<<<<<<<<<<<<
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_fmu_2); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "pyfmi\fmi.pyx":3045
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu.endswith('.fmu'):
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *         #Check that the file exists
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_FMUModel_must_be_instantiated_wi); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "pyfmi\fmi.pyx":3050
 *         self._fmu_full_path = encode(os.path.abspath(os.path.join(path,fmu)))
 *         if not os.path.isfile(self._fmu_full_path):
 *             raise FMUException('Could not locate the FMU in the specified directory.')             # <<<<<<<<<<<<<<
 * 
 *         # Create a struct for allocation
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_Could_not_locate_the_FMU_in_the); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "pyfmi\fmi.pyx":3068
 *                 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_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_The_FMU_version_could_not_be_det_2); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "pyfmi\fmi.pyx":3075
 *                 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_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_The_FMU_version_is_not_supported_2); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "pyfmi\fmi.pyx":3085
 *                 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_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_The_XML_could_not_be_read_Enable); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "pyfmi\fmi.pyx":3098
 *                 raise FMUException("The FMU kind could not be determined. "+last_error)
 *             else:
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         elif self._fmu_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *             if isinstance(self,FMUModelME2):
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_The_FMU_kind_could_not_be_determ_2); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "pyfmi\fmi.pyx":3105
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_cs
 *             else:
 *                 raise FMUException("FMUModelBase2 cannot be used directly, use FMUModelME2 or FMUModelCS2.")             # <<<<<<<<<<<<<<
 * 
 *         #Connect the DLL
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_FMUModelBase2_cannot_be_used_dir); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "pyfmi\fmi.pyx":3114
 *                 raise FMUException("Error loading the binary. " + last_error)
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         self._allocated_dll = 1
 * 
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_Error_loading_the_binary_Enable); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "pyfmi\fmi.pyx":3127
 * 
 *         #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_tuple__91 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "pyfmi\fmi.pyx":3163
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_Real_values); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "pyfmi\fmi.pyx":3194
 * 
 *         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_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_The_length_of_valueref_and_value); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "pyfmi\fmi.pyx":3199
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_Real_values); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "pyfmi\fmi.pyx":3232
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_Integer_values); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "pyfmi\fmi.pyx":3263
 * 
 *         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_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_The_length_of_valueref_and_value); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "pyfmi\fmi.pyx":3268
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_boolean(self, valueref):
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_Integer_values); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "pyfmi\fmi.pyx":3314
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         #return val==FMI_TRUE
 */
  __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_Boolean_values); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "pyfmi\fmi.pyx":3356
 * 
 *         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_tuple__99 = PyTuple_Pack(1, __pyx_kp_s_The_length_of_valueref_and_value); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "pyfmi\fmi.pyx":3364
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
  __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_Boolean_values); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);

  /* "pyfmi\fmi.pyx":3457
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     def _get(self, variable_name):
 */
  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_s_Type_not_supported); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);

  /* "pyfmi\fmi.pyx":3478
 *             return self.get_boolean([ref])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 */
  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_Type_not_supported); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "pyfmi\fmi.pyx":3482
 *     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_tuple__103 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "pyfmi\fmi.pyx":3507
 *                     if line == "":
 *                         break
 *                     log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 *         return log
 * 
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s__23); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "pyfmi\fmi.pyx":3502
 *         log = []
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     line = file.readline()
 */
  __pyx_tuple__105 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "pyfmi\fmi.pyx":3553
 *             fmuType = FMIL.fmi2_cosimulation
 *         else:
 *             raise FMUException('The instance is not curent an instance of an ME-model or a CS-model. Use load_fmu for correct loading.')             # <<<<<<<<<<<<<<
 * 
 *         name = encode(name)
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_The_instance_is_not_curent_an_in); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "pyfmi\fmi.pyx":3559
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def setup_experiment(self, tolerance_defined=True, tolerance="Default", start_time="Default", stop_time_defined=False, stop_time="Default"):
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_instantiate_the_model); if (unlikely(!__pyx_tuple__107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "pyfmi\fmi.pyx":3592
 * 
 *         if status != 0:
 *             raise FMUException('Failed to setup the experiment.')             # <<<<<<<<<<<<<<
 * 
 *     def reset(self):
 */
  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_setup_the_experiment); if (unlikely(!__pyx_tuple__108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "pyfmi\fmi.pyx":3603
 *         status = FMIL.fmi2_import_reset(self._fmu)
 *         if status != 0:
 *             raise FMUException('An error occured when reseting the model, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_tuple__109 = PyTuple_Pack(1, __pyx_kp_s_An_error_occured_when_reseting_t); if (unlikely(!__pyx_tuple__109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "pyfmi\fmi.pyx":3629
 *         """
 *         if self.time == None:
 *             raise FMUException("Setup Experiment has to be called prior to the initialization method.")             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_enter_initialization_mode(self._fmu)
 */
  __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_s_Setup_Experiment_has_to_be_calle); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "pyfmi\fmi.pyx":3635
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Enter Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_Enter_Initialize_returned_with_a); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "pyfmi\fmi.pyx":3639
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 logging.warning('Enter Initialize returned with a warning.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_Enter_Initialize_returned_with_a_2); if (unlikely(!__pyx_tuple__112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "pyfmi\fmi.pyx":3644
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Enter Initialize returned with an error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_Enter_Initialize_returned_with_a_3); if (unlikely(!__pyx_tuple__113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "pyfmi\fmi.pyx":3648
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Enter Initialize returned with an error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_Enter_Initialize_returned_with_a_4); if (unlikely(!__pyx_tuple__114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "pyfmi\fmi.pyx":3655
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Exit Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_Exit_Initialize_returned_with_a); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "pyfmi\fmi.pyx":3659
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 logging.warning('Exit Initialize returned with a warning.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s_Exit_Initialize_returned_with_a_2); if (unlikely(!__pyx_tuple__116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);

  /* "pyfmi\fmi.pyx":3664
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Exit Initialize returned with an error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_tuple__117 = PyTuple_Pack(1, __pyx_kp_s_Exit_Initialize_returned_with_an); if (unlikely(!__pyx_tuple__117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);

  /* "pyfmi\fmi.pyx":3668
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Exit Initialize returned with an error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_s_Exit_Initialize_returned_with_an_2); if (unlikely(!__pyx_tuple__118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "pyfmi\fmi.pyx":3695
 *         """
 *         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_tuple__119 = PyTuple_Pack(1, __pyx_kp_s_Invalid_log_level_for_FMI_Librar); if (unlikely(!__pyx_tuple__119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "pyfmi\fmi.pyx":3711
 *             return level
 *         else:
 *             raise FMUException('Logging is not enabled')             # <<<<<<<<<<<<<<
 * 
 *     def set_debug_logging(self, logging_on, categories = []):
 */
  __pyx_tuple__120 = PyTuple_Pack(1, __pyx_kp_s_Logging_is_not_enabled); if (unlikely(!__pyx_tuple__120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);

  /* "pyfmi\fmi.pyx":3744
 * 
 *         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_tuple__122 = PyTuple_Pack(1, __pyx_kp_s_Currently_the_logging_of_categor); if (unlikely(!__pyx_tuple__122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "pyfmi\fmi.pyx":3749
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def get_categories(self):
 */
  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_debugging_opti); if (unlikely(!__pyx_tuple__123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "pyfmi\fmi.pyx":3804
 *                 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_tuple__124 = PyTuple_Pack(1, __pyx_kp_s_Either_provide_value_reference_o); if (unlikely(!__pyx_tuple__124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "pyfmi\fmi.pyx":3808
 *         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_tuple__125 = PyTuple_Pack(1, __pyx_kp_s_The_variable_is_not_a_real_varia); if (unlikely(!__pyx_tuple__125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "pyfmi\fmi.pyx":4403
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self, variable_name):
 */
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_kp_s_Unknown_variable_type); if (unlikely(!__pyx_tuple__126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "pyfmi\fmi.pyx":4446
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self, variable_name):
 */
  __pyx_tuple__127 = PyTuple_Pack(1, __pyx_kp_s_The_variable_type_does_not_have); if (unlikely(!__pyx_tuple__127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);

  /* "pyfmi\fmi.pyx":4489
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 *     def get_fmu_state(self):
 */
  __pyx_tuple__128 = PyTuple_Pack(1, __pyx_kp_s_The_variable_type_does_not_have_2); if (unlikely(!__pyx_tuple__128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);

  /* "pyfmi\fmi.pyx":4752
 *                 regexp.append(re.compile(regex))
 *         else:
 *             raise FMUException("Unknown input.")             # <<<<<<<<<<<<<<
 *         return regexp
 * 
 */
  __pyx_tuple__129 = PyTuple_Pack(1, __pyx_kp_s_Unknown_input); if (unlikely(!__pyx_tuple__129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "pyfmi\fmi.pyx":4813
 *         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_tuple__130 = PyTuple_Pack(1, __pyx_kp_s_The_returned_states_list_is_NULL); if (unlikely(!__pyx_tuple__130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);

  /* "pyfmi\fmi.pyx":4848
 *             for i in range(len(self._states_references)):
 *                 v[i] = 1.0
 *                 A[:, i] = self.get_directional_derivative(self._states_references, self._derivatives_references, v)             # <<<<<<<<<<<<<<
 *                 v[i] = 0.0
 * 
 */
  __pyx_slice__131 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__131);
  __Pyx_GIVEREF(__pyx_slice__131);

  /* "pyfmi\fmi.pyx":4865
 *             for i in range(len(self._inputs_references)):
 *                 v[i] = 1.0
 *                 B[:, i] = self.get_directional_derivative(self._inputs_references, self._derivatives_references, v)             # <<<<<<<<<<<<<<
 *                 v[i] = 0.0
 *         if C:
 */
  __pyx_slice__132 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__132);
  __Pyx_GIVEREF(__pyx_slice__132);

  /* "pyfmi\fmi.pyx":4881
 *             for i in range(len(self._states_references)):
 *                 v[i] = 1.0
 *                 C[:, i] = self.get_directional_derivative(self._states_references, self._outputs_references, v)             # <<<<<<<<<<<<<<
 *                 v[i] = 0.0
 *         if D:
 */
  __pyx_slice__133 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__133);
  __Pyx_GIVEREF(__pyx_slice__133);

  /* "pyfmi\fmi.pyx":4897
 *             for i in range(len(self._inputs_references)):
 *                 v[i] = 1.0
 *                 D[:, i] = self.get_directional_derivative(self._inputs_references, self._outputs_references, v)             # <<<<<<<<<<<<<<
 *                 v[i] = 0.0
 * 
 */
  __pyx_slice__134 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__134);
  __Pyx_GIVEREF(__pyx_slice__134);

  /* "pyfmi\fmi.pyx":4919
 * 
 *         if variable_list == NULL:
 *             raise FMUException("The returned derivatives states list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
  __pyx_tuple__135 = PyTuple_Pack(1, __pyx_kp_s_The_returned_derivatives_states); if (unlikely(!__pyx_tuple__135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);

  /* "pyfmi\fmi.pyx":5021
 * 
 *         if not self._provides_directional_derivatives():
 *             raise FMUException('This FMU does not provide directional derivatives')             # <<<<<<<<<<<<<<
 * 
 *         if len(var_ref) != len(v):
 */
  __pyx_tuple__136 = PyTuple_Pack(1, __pyx_kp_s_This_FMU_does_not_provide_direct); if (unlikely(!__pyx_tuple__136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);

  /* "pyfmi\fmi.pyx":5024
 * 
 *         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_tuple__137 = PyTuple_Pack(1, __pyx_kp_s_The_length_of_the_list_with_vari); if (unlikely(!__pyx_tuple__137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);

  /* "pyfmi\fmi.pyx":5038
 * 
 *         if status != 0:
 *             raise FMUException('An error occured while getting the directional derivative, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         return dz
 */
  __pyx_tuple__138 = PyTuple_Pack(1, __pyx_kp_s_An_error_occured_while_getting_t); if (unlikely(!__pyx_tuple__138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);

  /* "pyfmi\fmi.pyx":5190
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_cs:
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:
 *                 raise FMUException("This class only supports FMI 2.0 for Co-simulation.")             # <<<<<<<<<<<<<<
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 */
  __pyx_tuple__140 = PyTuple_Pack(1, __pyx_kp_s_This_class_only_supports_FMI_2_0); if (unlikely(!__pyx_tuple__140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);

  /* "pyfmi\fmi.pyx":5193
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 *             raise FMUException('Models that need an execution tool are not supported')             # <<<<<<<<<<<<<<
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_kp_s_Models_that_need_an_execution_to); if (unlikely(!__pyx_tuple__141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);

  /* "pyfmi\fmi.pyx":5305
 *         status = FMIL.fmi2_import_cancel_step(self._fmu)
 *         if status != 0:
 *             raise FMUException('An error occured while canceling the step')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__142 = PyTuple_Pack(1, __pyx_kp_s_An_error_occured_while_canceling); if (unlikely(!__pyx_tuple__142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);

  /* "pyfmi\fmi.pyx":5338
 * 
 *         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_tuple__143 = PyTuple_Pack(1, __pyx_kp_s_The_order_must_be_greater_than_z_2); if (unlikely(!__pyx_tuple__143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);

  /* "pyfmi\fmi.pyx":5340
 *             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_tuple__144 = PyTuple_Pack(1, __pyx_kp_s_The_FMU_does_not_support_input_d); if (unlikely(!__pyx_tuple__144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);

  /* "pyfmi\fmi.pyx":5351
 *                 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_tuple__145 = PyTuple_Pack(1, __pyx_kp_s_The_variables_must_either_be_a_s); if (unlikely(!__pyx_tuple__145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);

  /* "pyfmi\fmi.pyx":5357
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     def get_output_derivatives(self, variables, FMIL.fmi2_integer_t order):
 */
  __pyx_tuple__146 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_Real_input_der); if (unlikely(!__pyx_tuple__146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);

  /* "pyfmi\fmi.pyx":5403
 *                 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_tuple__147 = PyTuple_Pack(1, __pyx_kp_s_The_variables_must_either_be_a_s); if (unlikely(!__pyx_tuple__147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);

  /* "pyfmi\fmi.pyx":5411
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_tuple__148 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_Real_output_de); if (unlikely(!__pyx_tuple__148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "pyfmi\fmi.pyx":5446
 *             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_tuple__149 = PyTuple_Pack(1, __pyx_kp_s_Status_kind_has_to_be_between_0); if (unlikely(!__pyx_tuple__149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);

  /* "pyfmi\fmi.pyx":5450
 *         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_tuple__150 = PyTuple_Pack(1, __pyx_kp_s_An_error_occured_while_retriving); if (unlikely(!__pyx_tuple__150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);

  /* "pyfmi\fmi.pyx":5478
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__151 = PyTuple_Pack(1, __pyx_kp_s_Status_kind_has_to_be_between_0); if (unlikely(!__pyx_tuple__151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);

  /* "pyfmi\fmi.pyx":5483
 *         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_tuple__152 = PyTuple_Pack(1, __pyx_kp_s_An_error_occured_while_retriving); if (unlikely(!__pyx_tuple__152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);

  /* "pyfmi\fmi.pyx":5511
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__153 = PyTuple_Pack(1, __pyx_kp_s_Status_kind_has_to_be_between_0); if (unlikely(!__pyx_tuple__153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);

  /* "pyfmi\fmi.pyx":5516
 *         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_tuple__154 = PyTuple_Pack(1, __pyx_kp_s_An_error_occured_while_retriving); if (unlikely(!__pyx_tuple__154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);

  /* "pyfmi\fmi.pyx":5544
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__155 = PyTuple_Pack(1, __pyx_kp_s_Status_kind_has_to_be_between_0); if (unlikely(!__pyx_tuple__155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);

  /* "pyfmi\fmi.pyx":5549
 *         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_tuple__156 = PyTuple_Pack(1, __pyx_kp_s_An_error_occured_while_retriving); if (unlikely(!__pyx_tuple__156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);

  /* "pyfmi\fmi.pyx":5577
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__157 = PyTuple_Pack(1, __pyx_kp_s_Status_kind_has_to_be_between_0); if (unlikely(!__pyx_tuple__157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);

  /* "pyfmi\fmi.pyx":5582
 *         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_tuple__158 = PyTuple_Pack(1, __pyx_kp_s_An_error_occured_while_retriving); if (unlikely(!__pyx_tuple__158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);

  /* "pyfmi\fmi.pyx":5753
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_me:
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:
 *                 raise FMUException('This class only supports FMI 2.0 for Model Exchange.')             # <<<<<<<<<<<<<<
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 */
  __pyx_tuple__161 = PyTuple_Pack(1, __pyx_kp_s_This_class_only_supports_FMI_2_0_2); if (unlikely(!__pyx_tuple__161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);

  /* "pyfmi\fmi.pyx":5756
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 *             raise FMUException('Models that need an execution tool are not supported')             # <<<<<<<<<<<<<<
 * 
 *         self._eventInfo.newDiscreteStatesNeeded           = FMI2_FALSE
 */
  __pyx_tuple__162 = PyTuple_Pack(1, __pyx_kp_s_Models_that_need_an_execution_to); if (unlikely(!__pyx_tuple__162)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);

  /* "pyfmi\fmi.pyx":5817
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 *         self.__t = t
 * 
 */
  __pyx_tuple__163 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_time); if (unlikely(!__pyx_tuple__163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);

  /* "pyfmi\fmi.pyx":5875
 * 
 *         if status != 0:
 *             raise FMUException('Failed to enter event mode.')             # <<<<<<<<<<<<<<
 * 
 *     def enter_continuous_time_mode(self):
 */
  __pyx_tuple__164 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_enter_event_mode); if (unlikely(!__pyx_tuple__164)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);

  /* "pyfmi\fmi.pyx":5886
 * 
 *         if status != 0:
 *             raise FMUException('Failed to enter continuous time mode.')             # <<<<<<<<<<<<<<
 * 
 *     def get_event_indicators(self):
 */
  __pyx_tuple__165 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_enter_continuous_time); if (unlikely(!__pyx_tuple__165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);

  /* "pyfmi\fmi.pyx":5909
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_tuple__166 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_event_indicato); if (unlikely(!__pyx_tuple__166)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);

  /* "pyfmi\fmi.pyx":6007
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         return enterEventMode==FMI2_TRUE, terminateSimulation==FMI2_TRUE
 */
  __pyx_tuple__167 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_call_FMI_Completed_Ste); if (unlikely(!__pyx_tuple__167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);

  /* "pyfmi\fmi.pyx":6024
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_tuple__168 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_retrieve_the_continuou); if (unlikely(!__pyx_tuple__168)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);

  /* "pyfmi\fmi.pyx":6041
 * 
 *         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_tuple__169 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_new_continuous); if (unlikely(!__pyx_tuple__169)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);

  /* "pyfmi\fmi.pyx":6049
 * 
 *         if status >= 3:
 *             raise FMUException('Failed to set the new continuous states.')             # <<<<<<<<<<<<<<
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,
 */
  __pyx_tuple__170 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_set_the_new_continuous_2); if (unlikely(!__pyx_tuple__170)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);

  /* "pyfmi\fmi.pyx":6072
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_tuple__171 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_get_the_nominal_values); if (unlikely(!__pyx_tuple__171)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);

  /* "pyfmi\fmi.pyx":6269
 * 
 *     # 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_tuple__173 = PyTuple_Pack(1, __pyx_kp_s_fmu_2); if (unlikely(!__pyx_tuple__173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);

  /* "pyfmi\fmi.pyx":6270
 *     # 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_tuple__174 = PyTuple_Pack(1, __pyx_kp_s_FMUModel_must_be_instantiated_wi); if (unlikely(!__pyx_tuple__174)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);

  /* "pyfmi\fmi.pyx":6302
 *             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_tuple__175 = PyTuple_Pack(1, __pyx_kp_s_The_FMU_version_could_not_be_det_2); if (unlikely(!__pyx_tuple__175)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);

  /* "pyfmi\fmi.pyx":6308
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Parse the XML
 */
  __pyx_tuple__176 = PyTuple_Pack(1, __pyx_kp_s_PyFMI_currently_only_supports_FM); if (unlikely(!__pyx_tuple__176)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);

  /* "pyfmi\fmi.pyx":6317
 *             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_tuple__177 = PyTuple_Pack(1, __pyx_kp_s_The_XML_file_could_not_be_parsed_2); if (unlikely(!__pyx_tuple__177)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);

  /* "pyfmi\fmi.pyx":6335
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Delete the XML
 */
  __pyx_tuple__178 = PyTuple_Pack(1, __pyx_kp_s_PyFMI_currently_only_supports_FM); if (unlikely(!__pyx_tuple__178)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);

  /* "pyfmi\fmi.pyx":6357
 *             if line == "":
 *                 break
 *             log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(log)):
 */
  __pyx_tuple__179 = PyTuple_Pack(1, __pyx_kp_s__23); if (unlikely(!__pyx_tuple__179)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);

  /* "pyfmi\fmi.pyx":6352
 * def _handle_load_fmu_exception(fmu, log_file):
 *     log = []
 *     with open(log_file,'r') as file:             # <<<<<<<<<<<<<<
 *         while True:
 *             line = file.readline()
 */
  __pyx_tuple__180 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__180)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);

  /* "pyfmi\fmi.pyx":6424
 *     # 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_tuple__182 = PyTuple_Pack(1, __pyx_kp_s_fmu_2); if (unlikely(!__pyx_tuple__182)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);

  /* "pyfmi\fmi.pyx":6425
 *     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_tuple__183 = PyTuple_Pack(1, __pyx_kp_s_FMUModel_must_be_instantiated_wi); if (unlikely(!__pyx_tuple__183)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);

  /* "pyfmi\fmi.pyx":6429
 *     #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_tuple__184 = PyTuple_Pack(1, __pyx_kp_s_Could_not_locate_the_FMU_in_the); if (unlikely(!__pyx_tuple__184)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__184);
  __Pyx_GIVEREF(__pyx_tuple__184);

  /* "pyfmi\fmi.pyx":6457
 *             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_tuple__185 = PyTuple_Pack(1, __pyx_kp_s_The_attribute_enable_logging_is); if (unlikely(!__pyx_tuple__185)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);

  /* "pyfmi\fmi.pyx":6497
 *         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_tuple__186 = PyTuple_Pack(1, __pyx_kp_s_The_FMU_version_could_not_be_det_2); if (unlikely(!__pyx_tuple__186)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__186);
  __Pyx_GIVEREF(__pyx_tuple__186);

  /* "pyfmi\fmi.pyx":6509
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is unsupported. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__187 = PyTuple_Pack(1, __pyx_kp_s_The_FMU_version_is_unsupported_E); if (unlikely(!__pyx_tuple__187)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);

  /* "pyfmi\fmi.pyx":6527
 *             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_tuple__188 = PyTuple_Pack(1, __pyx_kp_s_The_XML_could_not_be_read_Enable); if (unlikely(!__pyx_tuple__188)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__188);
  __Pyx_GIVEREF(__pyx_tuple__188);

  /* "pyfmi\fmi.pyx":6541
 *             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_tuple__189 = PyTuple_Pack(1, __pyx_kp_s_PyFMI_does_not_support_co_simula); if (unlikely(!__pyx_tuple__189)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);

  /* "pyfmi\fmi.pyx":6563
 *             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_tuple__190 = PyTuple_Pack(1, __pyx_kp_s_The_XML_could_not_be_read_Enable); if (unlikely(!__pyx_tuple__190)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__190);
  __Pyx_GIVEREF(__pyx_tuple__190);

  /* "pyfmi\fmi.pyx":6578
 *             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_tuple__191 = PyTuple_Pack(1, __pyx_kp_s_The_FMU_kind_could_not_be_determ_2); if (unlikely(!__pyx_tuple__191)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);

  /* "pyfmi\fmi.pyx":6613
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is not found. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *     #Delete
 */
  __pyx_tuple__192 = PyTuple_Pack(1, __pyx_kp_s_The_FMU_version_is_not_found_Ena); if (unlikely(!__pyx_tuple__192)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":215
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_tuple__193 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__193)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":219
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_tuple__194 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__194)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__194);
  __Pyx_GIVEREF(__pyx_tuple__194);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":257
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
  __pyx_tuple__195 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__195)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":799
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
  __pyx_tuple__196 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__196)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__196);
  __Pyx_GIVEREF(__pyx_tuple__196);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":803
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
  __pyx_tuple__197 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__197)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":823
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
  __pyx_tuple__198 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__198)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__198);
  __Pyx_GIVEREF(__pyx_tuple__198);

  /* "pyfmi\fmi.pyx":42
 * if python3_flag:
 *     import codecs
 *     def encode(x):             # <<<<<<<<<<<<<<
 *         return codecs.latin_1_encode(x)[0]
 *     def decode(x):
 */
  __pyx_tuple__199 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__199)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);
  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Development_PyFMI_branches_PyF, __pyx_n_s_encode, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":44
 *     def encode(x):
 *         return codecs.latin_1_encode(x)[0]
 *     def decode(x):             # <<<<<<<<<<<<<<
 *         return x.decode()
 * else:
 */
  __pyx_tuple__201 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__201)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Development_PyFMI_branches_PyF, __pyx_n_s_decode, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":47
 *         return x.decode()
 * else:
 *     def encode(x):             # <<<<<<<<<<<<<<
 *         return x
 *     def decode(x):
 */
  __pyx_tuple__203 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__203)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);
  __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Development_PyFMI_branches_PyF, __pyx_n_s_encode, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":49
 *     def encode(x):
 *         return x
 *     def decode(x):             # <<<<<<<<<<<<<<
 *         return x
 * 
 */
  __pyx_tuple__205 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__205)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);
  __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Development_PyFMI_branches_PyF, __pyx_n_s_decode, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":118
 * FMI_ME                 = FMIL.fmi1_fmu_kind_enu_me
 * FMI_CS_STANDALONE      = FMIL.fmi1_fmu_kind_enu_cs_standalone
 * FMI_MIME_CS_STANDALONE = encode("application/x-fmu-sharedlibrary")             # <<<<<<<<<<<<<<
 * 
 * FMI_REGISTER_GLOBALLY = 1
 */
  __pyx_tuple__209 = PyTuple_Pack(1, __pyx_kp_s_application_x_fmu_sharedlibrary); if (unlikely(!__pyx_tuple__209)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);

  /* "pyfmi\fmi.pyx":6245
 *         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_tuple__210 = PyTuple_Pack(16, __pyx_n_s_fmu, __pyx_n_s_path, __pyx_n_s_enable_logging, __pyx_n_s_log_file_name, __pyx_n_s_callBackFunctions, __pyx_n_s_callbacks, __pyx_n_s_context, __pyx_n_s_fmu_3, __pyx_n_s_last_error, __pyx_n_s_allocated_context, __pyx_n_s_allocated_xml, __pyx_n_s_fmu_temp_dir, __pyx_n_s_fmu_full_path, __pyx_n_s_version, __pyx_n_s_fmu_kind, __pyx_n_s_model); if (unlikely(!__pyx_tuple__210)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);
  __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Development_PyFMI_branches_PyF, __pyx_n_s_load_fmu_deprecated, 6245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":6350
 *     return model
 * 
 * def _handle_load_fmu_exception(fmu, log_file):             # <<<<<<<<<<<<<<
 *     log = []
 *     with open(log_file,'r') as file:
 */
  __pyx_tuple__212 = PyTuple_Pack(6, __pyx_n_s_fmu, __pyx_n_s_log_file, __pyx_n_s_log, __pyx_n_s_file, __pyx_n_s_line, __pyx_n_s_i); if (unlikely(!__pyx_tuple__212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);
  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Development_PyFMI_branches_PyF, __pyx_n_s_handle_load_fmu_exception, 6350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":6362
 *         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_tuple__214 = PyTuple_Pack(22, __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, __pyx_n_s_context, __pyx_n_s_callbacks, __pyx_n_s_callBackFunctions_1, __pyx_n_s_callBackFunctions_2, __pyx_n_s_last_error, __pyx_n_s_version, __pyx_n_s_fmu_1, __pyx_n_s_fmu_2_2, __pyx_n_s_fmu_1_kind, __pyx_n_s_fmu_2_kind, __pyx_n_s_log_file_c, __pyx_n_s_fmu_temp_dir, __pyx_n_s_model, __pyx_n_s_log_file, __pyx_n_s_fmu_full_path, __pyx_n_s_original_enable_logging); if (unlikely(!__pyx_tuple__214)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);
  __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(6, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Development_PyFMI_branches_PyF, __pyx_n_s_load_fmu, 6362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6362; __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_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_0_01 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_float_0_01)) {__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;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initfmi(void); /*proto*/
PyMODINIT_FUNC initfmi(void)
#else
PyMODINIT_FUNC PyInit_fmi(void); /*proto*/
PyMODINIT_FUNC PyInit_fmi(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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("fmi", __pyx_methods, __pyx_k_Module_containing_the_FMI_inter, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_pyfmi__fmi) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "pyfmi.fmi")) {
      if (unlikely(PyDict_SetItemString(modules, "pyfmi.fmi", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- 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 = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5pyfmi_3fmi_ModelBase.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "ModelBase", (PyObject *)&__pyx_type_5pyfmi_3fmi_ModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __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 = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5pyfmi_3fmi_ScalarVariable.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "ScalarVariable", (PyObject *)&__pyx_type_5pyfmi_3fmi_ScalarVariable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __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 = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5pyfmi_3fmi_ScalarVariable2.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "ScalarVariable2", (PyObject *)&__pyx_type_5pyfmi_3fmi_ScalarVariable2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __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 = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5pyfmi_3fmi_FMUState2.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "FMUState2", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUState2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUState2 = &__pyx_type_5pyfmi_3fmi_FMUState2;
  __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase = &__pyx_vtable_5pyfmi_3fmi_FMUModelBase;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase._logger = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, jm_string, int, jm_string))__pyx_f_5pyfmi_3fmi_12FMUModelBase__logger;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase._internal_set_fmu_null = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase__internal_set_fmu_null;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_description = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_description;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_data_type = (enum fmi1_base_type_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_data_type;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_valueref = (fmi1_value_reference_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_valueref;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_fixed = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_fixed;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_start = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_start;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_max = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_max;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_min = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_min;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_variability = (enum fmi1_variability_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_variability;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_causality = (enum fmi1_causality_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_causality;
  __pyx_type_5pyfmi_3fmi_FMUModelBase.tp_base = __pyx_ptype_5pyfmi_3fmi_ModelBase;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_FMUModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5pyfmi_3fmi_FMUModelBase.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelBase, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__.doc = __pyx_doc_5pyfmi_3fmi_12FMUModelBase___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelBase.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "FMUModelBase", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __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 = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5pyfmi_3fmi_FMUModelCS1.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelCS1.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelCS1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "FMUModelCS1", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelCS1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __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 = 2386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5pyfmi_3fmi_FMUModelME1.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelME1.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelME1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "FMUModelME1", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelME1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModelME1 = &__pyx_type_5pyfmi_3fmi_FMUModelME1;
  __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2 = &__pyx_vtable_5pyfmi_3fmi_FMUModelBase2;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2._logger = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, jm_string, int, jm_string))__pyx_f_5pyfmi_3fmi_13FMUModelBase2__logger;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_valueref = (fmi2_value_reference_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_valueref;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_data_type = (fmi2_base_type_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_data_type;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_description = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_description;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_variability = (fmi2_variability_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_variability;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_causality = (fmi2_causality_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_causality;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_start = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_start;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_max = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_max;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_min = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_min;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_initial = (fmi2_initial_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_initial;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.serialize_fmu_state = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_serialize_fmu_state;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.deserialize_fmu_state = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_deserialize_fmu_state;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.serialized_fmu_state_size = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_serialized_fmu_state_size;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2._add_scalar_variables = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, fmi2_import_variable_list_t *))__pyx_f_5pyfmi_3fmi_13FMUModelBase2__add_scalar_variables;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2._add_scalar_variable = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, fmi2_import_variable_t *))__pyx_f_5pyfmi_3fmi_13FMUModelBase2__add_scalar_variable;
  __pyx_type_5pyfmi_3fmi_FMUModelBase2.tp_base = __pyx_ptype_5pyfmi_3fmi_ModelBase;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_FMUModelBase2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5pyfmi_3fmi_FMUModelBase2.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelBase2, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pyfmi_3fmi_13FMUModelBase2___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pyfmi_3fmi_13FMUModelBase2___init__.doc = __pyx_doc_5pyfmi_3fmi_13FMUModelBase2___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pyfmi_3fmi_13FMUModelBase2___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelBase2.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "FMUModelBase2", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelBase2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2950; __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 = 5155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5pyfmi_3fmi_FMUModelCS2.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelCS2, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelCS2___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelCS2___init__.doc = __pyx_doc_5pyfmi_3fmi_11FMUModelCS2___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pyfmi_3fmi_11FMUModelCS2___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelCS2.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelCS2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "FMUModelCS2", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelCS2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModelCS2 = &__pyx_type_5pyfmi_3fmi_FMUModelCS2;
  __pyx_vtabptr_5pyfmi_3fmi_FMUModelME2 = &__pyx_vtable_5pyfmi_3fmi_FMUModelME2;
  __pyx_vtable_5pyfmi_3fmi_FMUModelME2.__pyx_base = *__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2;
  __pyx_vtable_5pyfmi_3fmi_FMUModelME2._get_time = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelME2__get_time;
  __pyx_vtable_5pyfmi_3fmi_FMUModelME2._set_time = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *, fmi2_real_t, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelME2__set_time;
  __pyx_vtable_5pyfmi_3fmi_FMUModelME2.get_derivatives = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelME2_get_derivatives;
  __pyx_type_5pyfmi_3fmi_FMUModelME2.tp_base = __pyx_ptype_5pyfmi_3fmi_FMUModelBase2;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_FMUModelME2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5pyfmi_3fmi_FMUModelME2.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelME2, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelME2___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelME2___init__.doc = __pyx_doc_5pyfmi_3fmi_11FMUModelME2___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pyfmi_3fmi_11FMUModelME2___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelME2.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelME2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "FMUModelME2", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelME2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5718; __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 = 6240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5pyfmi_3fmi_FMUModel.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModel.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "FMUModel", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModel = &__pyx_type_5pyfmi_3fmi_FMUModel;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "pyfmi\fmi.pyx":20
 * Module containing the FMI interface Python wrappers.
 * """
 * import os             # <<<<<<<<<<<<<<
 * import sys
 * import logging
 */
  __pyx_t_1 = __Pyx_Import(__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 (PyDict_SetItem(__pyx_d, __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(__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 (PyDict_SetItem(__pyx_d, __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(__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 (PyDict_SetItem(__pyx_d, __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(__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 (PyDict_SetItem(__pyx_d, __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(__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 (PyDict_SetItem(__pyx_d, __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(__pyx_n_s_OrderedDict);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_OrderedDict);
  __Pyx_GIVEREF(__pyx_n_s_OrderedDict);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __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(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __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 (PyDict_SetItem(__pyx_d, __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(__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 (PyDict_SetItem(__pyx_d, __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(__pyx_n_s_create_temp_dir);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_create_temp_dir);
  __Pyx_GIVEREF(__pyx_n_s_create_temp_dir);
  __Pyx_INCREF(__pyx_n_s_delete_temp_dir);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_delete_temp_dir);
  __Pyx_GIVEREF(__pyx_n_s_delete_temp_dir);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pyfmi_common_core, __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(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __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 (PyDict_SetItem(__pyx_d, __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 = __Pyx_ImportFrom(__pyx_t_1, __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 (PyDict_SetItem(__pyx_d, __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(__pyx_n_s_create_temp_file);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_create_temp_file);
  __Pyx_GIVEREF(__pyx_n_s_create_temp_file);
  __Pyx_INCREF(__pyx_n_s_delete_temp_file);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_delete_temp_file);
  __Pyx_GIVEREF(__pyx_n_s_delete_temp_file);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyfmi_common_core, __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(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __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 (PyDict_SetItem(__pyx_d, __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 = __Pyx_ImportFrom(__pyx_t_2, __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 (PyDict_SetItem(__pyx_d, __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
 * 
 * from pyfmi.common import python3_flag             # <<<<<<<<<<<<<<
 * 
 * if python3_flag:
 */
  __pyx_t_2 = PyList_New(1); 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_INCREF(__pyx_n_s_python3_flag);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_python3_flag);
  __Pyx_GIVEREF(__pyx_n_s_python3_flag);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pyfmi_common, __pyx_t_2, -1); 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;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_python3_flag); 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);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_python3_flag, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __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":40
 * from pyfmi.common import python3_flag
 * 
 * if python3_flag:             # <<<<<<<<<<<<<<
 *     import codecs
 *     def encode(x):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":41
 * 
 * if python3_flag:
 *     import codecs             # <<<<<<<<<<<<<<
 *     def encode(x):
 *         return codecs.latin_1_encode(x)[0]
 */
    __pyx_t_1 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":42
 * if python3_flag:
 *     import codecs
 *     def encode(x):             # <<<<<<<<<<<<<<
 *         return codecs.latin_1_encode(x)[0]
 *     def decode(x):
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_1encode, NULL, __pyx_n_s_pyfmi_fmi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_encode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":44
 *     def encode(x):
 *         return codecs.latin_1_encode(x)[0]
 *     def decode(x):             # <<<<<<<<<<<<<<
 *         return x.decode()
 * else:
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_3decode, NULL, __pyx_n_s_pyfmi_fmi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":47
 *         return x.decode()
 * else:
 *     def encode(x):             # <<<<<<<<<<<<<<
 *         return x
 *     def decode(x):
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_5encode, NULL, __pyx_n_s_pyfmi_fmi); 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 (PyDict_SetItem(__pyx_d, __pyx_n_s_encode, __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":49
 *     def encode(x):
 *         return x
 *     def decode(x):             # <<<<<<<<<<<<<<
 *         return x
 * 
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_7decode, NULL, __pyx_n_s_pyfmi_fmi); 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 (PyDict_SetItem(__pyx_d, __pyx_n_s_decode, __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;
  }
  __pyx_L2:;

  /* "pyfmi\fmi.pyx":52
 *         return x
 * 
 * int   = N.int32             # <<<<<<<<<<<<<<
 * N.int = N.int32
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); 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);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __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_d, __pyx_n_s_int, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":53
 * 
 * int   = N.int32
 * N.int = N.int32             # <<<<<<<<<<<<<<
 * 
 * """Basic flags related to FMI"""
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_int, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __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":57
 * """Basic flags related to FMI"""
 * 
 * FMI_TRUE  = '\x01'             # <<<<<<<<<<<<<<
 * FMI_FALSE = '\x00'
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_TRUE, __pyx_kp_s__207) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":58
 * 
 * FMI_TRUE  = '\x01'
 * FMI_FALSE = '\x00'             # <<<<<<<<<<<<<<
 * 
 * FMI2_TRUE = FMIL.fmi2_true
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_FALSE, __pyx_kp_s__208) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":60
 * FMI_FALSE = '\x00'
 * 
 * FMI2_TRUE = FMIL.fmi2_true             # <<<<<<<<<<<<<<
 * FMI2_FALSE = FMIL.fmi2_false
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_TRUE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":61
 * 
 * FMI2_TRUE = FMIL.fmi2_true
 * FMI2_FALSE = FMIL.fmi2_false             # <<<<<<<<<<<<<<
 * 
 * # Status
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_FALSE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":64
 * 
 * # Status
 * FMI_OK      = FMIL.fmi1_status_ok             # <<<<<<<<<<<<<<
 * FMI_WARNING = FMIL.fmi1_status_warning
 * FMI_DISCARD = FMIL.fmi1_status_discard
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_status_ok); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_OK, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":65
 * # Status
 * FMI_OK      = FMIL.fmi1_status_ok
 * FMI_WARNING = FMIL.fmi1_status_warning             # <<<<<<<<<<<<<<
 * FMI_DISCARD = FMIL.fmi1_status_discard
 * FMI_ERROR   = FMIL.fmi1_status_error
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_status_warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_WARNING, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":66
 * FMI_OK      = FMIL.fmi1_status_ok
 * FMI_WARNING = FMIL.fmi1_status_warning
 * FMI_DISCARD = FMIL.fmi1_status_discard             # <<<<<<<<<<<<<<
 * FMI_ERROR   = FMIL.fmi1_status_error
 * FMI_FATAL   = FMIL.fmi1_status_fatal
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_status_discard); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_DISCARD, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":67
 * FMI_WARNING = FMIL.fmi1_status_warning
 * FMI_DISCARD = FMIL.fmi1_status_discard
 * FMI_ERROR   = FMIL.fmi1_status_error             # <<<<<<<<<<<<<<
 * FMI_FATAL   = FMIL.fmi1_status_fatal
 * FMI_PENDING = FMIL.fmi1_status_pending
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_status_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_ERROR, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":68
 * FMI_DISCARD = FMIL.fmi1_status_discard
 * FMI_ERROR   = FMIL.fmi1_status_error
 * FMI_FATAL   = FMIL.fmi1_status_fatal             # <<<<<<<<<<<<<<
 * FMI_PENDING = FMIL.fmi1_status_pending
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_status_fatal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_FATAL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":69
 * FMI_ERROR   = FMIL.fmi1_status_error
 * FMI_FATAL   = FMIL.fmi1_status_fatal
 * FMI_PENDING = FMIL.fmi1_status_pending             # <<<<<<<<<<<<<<
 * 
 * FMI1_DO_STEP_STATUS       = FMIL.fmi1_do_step_status
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_status_pending); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_PENDING, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":71
 * FMI_PENDING = FMIL.fmi1_status_pending
 * 
 * FMI1_DO_STEP_STATUS       = FMIL.fmi1_do_step_status             # <<<<<<<<<<<<<<
 * FMI1_PENDING_STATUS       = FMIL.fmi1_pending_status
 * FMI1_LAST_SUCCESSFUL_TIME = FMIL.fmi1_last_successful_time
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_do_step_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI1_DO_STEP_STATUS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":72
 * 
 * FMI1_DO_STEP_STATUS       = FMIL.fmi1_do_step_status
 * FMI1_PENDING_STATUS       = FMIL.fmi1_pending_status             # <<<<<<<<<<<<<<
 * FMI1_LAST_SUCCESSFUL_TIME = FMIL.fmi1_last_successful_time
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_pending_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI1_PENDING_STATUS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":73
 * FMI1_DO_STEP_STATUS       = FMIL.fmi1_do_step_status
 * FMI1_PENDING_STATUS       = FMIL.fmi1_pending_status
 * FMI1_LAST_SUCCESSFUL_TIME = FMIL.fmi1_last_successful_time             # <<<<<<<<<<<<<<
 * 
 * # Types
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_last_successful_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI1_LAST_SUCCESSFUL_TIME, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":76
 * 
 * # Types
 * FMI_REAL        = FMIL.fmi1_base_type_real             # <<<<<<<<<<<<<<
 * FMI_INTEGER     = FMIL.fmi1_base_type_int
 * FMI_BOOLEAN     = FMIL.fmi1_base_type_bool
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_base_type_real); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_REAL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":77
 * # Types
 * FMI_REAL        = FMIL.fmi1_base_type_real
 * FMI_INTEGER     = FMIL.fmi1_base_type_int             # <<<<<<<<<<<<<<
 * FMI_BOOLEAN     = FMIL.fmi1_base_type_bool
 * FMI_STRING      = FMIL.fmi1_base_type_str
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_base_type_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_INTEGER, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":78
 * FMI_REAL        = FMIL.fmi1_base_type_real
 * FMI_INTEGER     = FMIL.fmi1_base_type_int
 * FMI_BOOLEAN     = FMIL.fmi1_base_type_bool             # <<<<<<<<<<<<<<
 * FMI_STRING      = FMIL.fmi1_base_type_str
 * FMI_ENUMERATION = FMIL.fmi1_base_type_enum
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_base_type_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_BOOLEAN, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":79
 * FMI_INTEGER     = FMIL.fmi1_base_type_int
 * FMI_BOOLEAN     = FMIL.fmi1_base_type_bool
 * FMI_STRING      = FMIL.fmi1_base_type_str             # <<<<<<<<<<<<<<
 * FMI_ENUMERATION = FMIL.fmi1_base_type_enum
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_base_type_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_STRING, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":80
 * FMI_BOOLEAN     = FMIL.fmi1_base_type_bool
 * FMI_STRING      = FMIL.fmi1_base_type_str
 * FMI_ENUMERATION = FMIL.fmi1_base_type_enum             # <<<<<<<<<<<<<<
 * 
 * FMI2_REAL        = FMIL.fmi2_base_type_real
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_base_type_enum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_ENUMERATION, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":82
 * FMI_ENUMERATION = FMIL.fmi1_base_type_enum
 * 
 * FMI2_REAL        = FMIL.fmi2_base_type_real             # <<<<<<<<<<<<<<
 * FMI2_INTEGER     = FMIL.fmi2_base_type_int
 * FMI2_BOOLEAN     = FMIL.fmi2_base_type_bool
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_base_type_real); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_REAL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":83
 * 
 * FMI2_REAL        = FMIL.fmi2_base_type_real
 * FMI2_INTEGER     = FMIL.fmi2_base_type_int             # <<<<<<<<<<<<<<
 * FMI2_BOOLEAN     = FMIL.fmi2_base_type_bool
 * FMI2_STRING      = FMIL.fmi2_base_type_str
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_base_type_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_INTEGER, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":84
 * FMI2_REAL        = FMIL.fmi2_base_type_real
 * FMI2_INTEGER     = FMIL.fmi2_base_type_int
 * FMI2_BOOLEAN     = FMIL.fmi2_base_type_bool             # <<<<<<<<<<<<<<
 * FMI2_STRING      = FMIL.fmi2_base_type_str
 * FMI2_ENUMERATION = FMIL.fmi2_base_type_enum
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_base_type_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_BOOLEAN, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":85
 * FMI2_INTEGER     = FMIL.fmi2_base_type_int
 * FMI2_BOOLEAN     = FMIL.fmi2_base_type_bool
 * FMI2_STRING      = FMIL.fmi2_base_type_str             # <<<<<<<<<<<<<<
 * FMI2_ENUMERATION = FMIL.fmi2_base_type_enum
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_base_type_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_STRING, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":86
 * FMI2_BOOLEAN     = FMIL.fmi2_base_type_bool
 * FMI2_STRING      = FMIL.fmi2_base_type_str
 * FMI2_ENUMERATION = FMIL.fmi2_base_type_enum             # <<<<<<<<<<<<<<
 * 
 * # Alias data
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_base_type_enum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_ENUMERATION, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":89
 * 
 * # Alias data
 * FMI_NO_ALIAS      = FMIL.fmi1_variable_is_not_alias             # <<<<<<<<<<<<<<
 * FMI_ALIAS         = FMIL.fmi1_variable_is_alias
 * FMI_NEGATED_ALIAS = FMIL.fmi1_variable_is_negated_alias
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variable_is_not_alias); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_NO_ALIAS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":90
 * # Alias data
 * FMI_NO_ALIAS      = FMIL.fmi1_variable_is_not_alias
 * FMI_ALIAS         = FMIL.fmi1_variable_is_alias             # <<<<<<<<<<<<<<
 * FMI_NEGATED_ALIAS = FMIL.fmi1_variable_is_negated_alias
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variable_is_alias); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_ALIAS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":91
 * FMI_NO_ALIAS      = FMIL.fmi1_variable_is_not_alias
 * FMI_ALIAS         = FMIL.fmi1_variable_is_alias
 * FMI_NEGATED_ALIAS = FMIL.fmi1_variable_is_negated_alias             # <<<<<<<<<<<<<<
 * 
 * # Variability
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variable_is_negated_alias); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_NEGATED_ALIAS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":94
 * 
 * # Variability
 * FMI_CONTINUOUS = FMIL.fmi1_variability_enu_continuous             # <<<<<<<<<<<<<<
 * FMI_CONSTANT   = FMIL.fmi1_variability_enu_constant
 * FMI_PARAMETER  = FMIL.fmi1_variability_enu_parameter
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variability_enu_continuous); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_CONTINUOUS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":95
 * # Variability
 * FMI_CONTINUOUS = FMIL.fmi1_variability_enu_continuous
 * FMI_CONSTANT   = FMIL.fmi1_variability_enu_constant             # <<<<<<<<<<<<<<
 * FMI_PARAMETER  = FMIL.fmi1_variability_enu_parameter
 * FMI_DISCRETE   = FMIL.fmi1_variability_enu_discrete
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variability_enu_constant); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_CONSTANT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":96
 * FMI_CONTINUOUS = FMIL.fmi1_variability_enu_continuous
 * FMI_CONSTANT   = FMIL.fmi1_variability_enu_constant
 * FMI_PARAMETER  = FMIL.fmi1_variability_enu_parameter             # <<<<<<<<<<<<<<
 * FMI_DISCRETE   = FMIL.fmi1_variability_enu_discrete
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variability_enu_parameter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_PARAMETER, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":97
 * FMI_CONSTANT   = FMIL.fmi1_variability_enu_constant
 * FMI_PARAMETER  = FMIL.fmi1_variability_enu_parameter
 * FMI_DISCRETE   = FMIL.fmi1_variability_enu_discrete             # <<<<<<<<<<<<<<
 * 
 * FMI2_CONSTANT   = FMIL.fmi2_variability_enu_constant
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variability_enu_discrete); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_DISCRETE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":99
 * FMI_DISCRETE   = FMIL.fmi1_variability_enu_discrete
 * 
 * FMI2_CONSTANT   = FMIL.fmi2_variability_enu_constant             # <<<<<<<<<<<<<<
 * FMI2_FIXED      = FMIL.fmi2_variability_enu_fixed
 * FMI2_TUNABLE    = FMIL.fmi2_variability_enu_tunable
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_variability_enu_constant); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_CONSTANT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":100
 * 
 * FMI2_CONSTANT   = FMIL.fmi2_variability_enu_constant
 * FMI2_FIXED      = FMIL.fmi2_variability_enu_fixed             # <<<<<<<<<<<<<<
 * FMI2_TUNABLE    = FMIL.fmi2_variability_enu_tunable
 * FMI2_DISCRETE   = FMIL.fmi2_variability_enu_discrete
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_variability_enu_fixed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_FIXED, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":101
 * FMI2_CONSTANT   = FMIL.fmi2_variability_enu_constant
 * FMI2_FIXED      = FMIL.fmi2_variability_enu_fixed
 * FMI2_TUNABLE    = FMIL.fmi2_variability_enu_tunable             # <<<<<<<<<<<<<<
 * FMI2_DISCRETE   = FMIL.fmi2_variability_enu_discrete
 * FMI2_CONTINUOUS = FMIL.fmi2_variability_enu_continuous
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_variability_enu_tunable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_TUNABLE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":102
 * FMI2_FIXED      = FMIL.fmi2_variability_enu_fixed
 * FMI2_TUNABLE    = FMIL.fmi2_variability_enu_tunable
 * FMI2_DISCRETE   = FMIL.fmi2_variability_enu_discrete             # <<<<<<<<<<<<<<
 * FMI2_CONTINUOUS = FMIL.fmi2_variability_enu_continuous
 * FMI2_UNKNOWN    = FMIL.fmi2_variability_enu_unknown
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_variability_enu_discrete); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_DISCRETE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":103
 * FMI2_TUNABLE    = FMIL.fmi2_variability_enu_tunable
 * FMI2_DISCRETE   = FMIL.fmi2_variability_enu_discrete
 * FMI2_CONTINUOUS = FMIL.fmi2_variability_enu_continuous             # <<<<<<<<<<<<<<
 * FMI2_UNKNOWN    = FMIL.fmi2_variability_enu_unknown
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_variability_enu_continuous); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_CONTINUOUS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":104
 * FMI2_DISCRETE   = FMIL.fmi2_variability_enu_discrete
 * FMI2_CONTINUOUS = FMIL.fmi2_variability_enu_continuous
 * FMI2_UNKNOWN    = FMIL.fmi2_variability_enu_unknown             # <<<<<<<<<<<<<<
 * 
 * # Causality
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_variability_enu_unknown); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_UNKNOWN, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":107
 * 
 * # Causality
 * FMI_INPUT    = FMIL.fmi1_causality_enu_input             # <<<<<<<<<<<<<<
 * FMI_OUTPUT   = FMIL.fmi1_causality_enu_output
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_causality_enu_input); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_INPUT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":108
 * # Causality
 * FMI_INPUT    = FMIL.fmi1_causality_enu_input
 * FMI_OUTPUT   = FMIL.fmi1_causality_enu_output             # <<<<<<<<<<<<<<
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal
 * FMI_NONE     = FMIL.fmi1_causality_enu_none
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_causality_enu_output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_OUTPUT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":109
 * FMI_INPUT    = FMIL.fmi1_causality_enu_input
 * FMI_OUTPUT   = FMIL.fmi1_causality_enu_output
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal             # <<<<<<<<<<<<<<
 * FMI_NONE     = FMIL.fmi1_causality_enu_none
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_causality_enu_internal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_INTERNAL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":110
 * FMI_OUTPUT   = FMIL.fmi1_causality_enu_output
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal
 * FMI_NONE     = FMIL.fmi1_causality_enu_none             # <<<<<<<<<<<<<<
 * 
 * FMI2_INPUT   = FMIL.fmi2_causality_enu_input
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_causality_enu_none); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_NONE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":112
 * FMI_NONE     = FMIL.fmi1_causality_enu_none
 * 
 * FMI2_INPUT   = FMIL.fmi2_causality_enu_input             # <<<<<<<<<<<<<<
 * FMI2_OUTPUT   = FMIL.fmi2_causality_enu_output
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_causality_enu_input); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_INPUT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":113
 * 
 * FMI2_INPUT   = FMIL.fmi2_causality_enu_input
 * FMI2_OUTPUT   = FMIL.fmi2_causality_enu_output             # <<<<<<<<<<<<<<
 * 
 * # FMI types
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_causality_enu_output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_OUTPUT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":116
 * 
 * # FMI types
 * FMI_ME                 = FMIL.fmi1_fmu_kind_enu_me             # <<<<<<<<<<<<<<
 * FMI_CS_STANDALONE      = FMIL.fmi1_fmu_kind_enu_cs_standalone
 * FMI_MIME_CS_STANDALONE = encode("application/x-fmu-sharedlibrary")
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_fmu_kind_enu_me); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_ME, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":117
 * # FMI types
 * FMI_ME                 = FMIL.fmi1_fmu_kind_enu_me
 * FMI_CS_STANDALONE      = FMIL.fmi1_fmu_kind_enu_cs_standalone             # <<<<<<<<<<<<<<
 * FMI_MIME_CS_STANDALONE = encode("application/x-fmu-sharedlibrary")
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_fmu_kind_enu_cs_standalone); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_CS_STANDALONE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":118
 * FMI_ME                 = FMIL.fmi1_fmu_kind_enu_me
 * FMI_CS_STANDALONE      = FMIL.fmi1_fmu_kind_enu_cs_standalone
 * FMI_MIME_CS_STANDALONE = encode("application/x-fmu-sharedlibrary")             # <<<<<<<<<<<<<<
 * 
 * FMI_REGISTER_GLOBALLY = 1
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__209, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __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_d, __pyx_n_s_FMI_MIME_CS_STANDALONE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":120
 * FMI_MIME_CS_STANDALONE = encode("application/x-fmu-sharedlibrary")
 * 
 * FMI_REGISTER_GLOBALLY = 1             # <<<<<<<<<<<<<<
 * FMI_DEFAULT_LOG_LEVEL = FMIL.jm_log_level_error
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_REGISTER_GLOBALLY, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":121
 * 
 * FMI_REGISTER_GLOBALLY = 1
 * FMI_DEFAULT_LOG_LEVEL = FMIL.jm_log_level_error             # <<<<<<<<<<<<<<
 * 
 * # INITIAL
 */
  __pyx_t_1 = PyInt_FromLong(jm_log_level_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_DEFAULT_LOG_LEVEL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":124
 * 
 * # INITIAL
 * FMI2_INITIAL_EXACT      = 0             # <<<<<<<<<<<<<<
 * FMI2_INITIAL_APPROX     = 1
 * FMI2_INITIAL_CALCULATED = 2
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_INITIAL_EXACT, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":125
 * # INITIAL
 * FMI2_INITIAL_EXACT      = 0
 * FMI2_INITIAL_APPROX     = 1             # <<<<<<<<<<<<<<
 * FMI2_INITIAL_CALCULATED = 2
 * FMI2_INITIAL_UNKNOWN    = 3
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_INITIAL_APPROX, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":126
 * FMI2_INITIAL_EXACT      = 0
 * FMI2_INITIAL_APPROX     = 1
 * FMI2_INITIAL_CALCULATED = 2             # <<<<<<<<<<<<<<
 * FMI2_INITIAL_UNKNOWN    = 3
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_INITIAL_CALCULATED, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":127
 * FMI2_INITIAL_APPROX     = 1
 * FMI2_INITIAL_CALCULATED = 2
 * FMI2_INITIAL_UNKNOWN    = 3             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI2_INITIAL_UNKNOWN, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":132
 * """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 (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_STATES, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":134
 * FMI_STATES = 1
 * """Evaluate Jacobian w.r.t. inputs."""
 * FMI_INPUTS = 2             # <<<<<<<<<<<<<<
 * """Evaluate Jacobian of derivatives."""
 * FMI_DERIVATIVES = 1
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_INPUTS, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":136
 * FMI_INPUTS = 2
 * """Evaluate Jacobian of derivatives."""
 * FMI_DERIVATIVES = 1             # <<<<<<<<<<<<<<
 * """Evaluate Jacobian of outputs."""
 * FMI_OUTPUTS = 2
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_DERIVATIVES, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":138
 * FMI_DERIVATIVES = 1
 * """Evaluate Jacobian of outputs."""
 * FMI_OUTPUTS = 2             # <<<<<<<<<<<<<<
 * 
 * #CALLBACKS
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMI_OUTPUTS, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":307
 *         return algorithm.get_default_options()
 * 
 * class FMUException(Exception):             # <<<<<<<<<<<<<<
 *     """
 *     An FMU exception.
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FMUException, __pyx_n_s_FMUException, (PyObject *) NULL, __pyx_n_s_pyfmi_fmi, __pyx_kp_s_An_FMU_exception); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FMUException, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FMUException, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":313
 *     pass
 * 
 * class PyEventInfo():             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_PyEventInfo, __pyx_n_s_PyEventInfo, (PyObject *) NULL, __pyx_n_s_pyfmi_fmi, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_PyEventInfo, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PyEventInfo, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __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":322
 *     """
 *     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 = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__3 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

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

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

  /* "pyfmi\fmi.pyx":343
 *         """
 *         return self._name
 *     name = property(_get_name)             # <<<<<<<<<<<<<<
 * 
 *     def _get_value_reference(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s_get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __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 = 343; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 343; __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":354
 *         """
 *         return self._value_reference
 *     value_reference = property(_get_value_reference)             # <<<<<<<<<<<<<<
 * 
 *     def _get_type(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s_get_value_reference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __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 = 354; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 354; __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":366
 *         """
 *         return self._type
 *     type = property(_get_type)             # <<<<<<<<<<<<<<
 * 
 *     def _get_description(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s_get_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __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 = 366; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 366; __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":378
 *         """
 *         return self._description
 *     description = property(_get_description)             # <<<<<<<<<<<<<<
 * 
 *     def _get_variability(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s_get_description); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __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 = 378; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable);

  /* "pyfmi\fmi.pyx":390
 *         """
 *         return self._variability
 *     variability = property(_get_variability)             # <<<<<<<<<<<<<<
 * 
 *     def _get_causality(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s_get_variability); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable);

  /* "pyfmi\fmi.pyx":402
 *         """
 *         return self._causality
 *     causality = property(_get_causality)             # <<<<<<<<<<<<<<
 * 
 *     def _get_alias(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s_get_causality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable);

  /* "pyfmi\fmi.pyx":414
 *         """
 *         return self._alias
 *     alias = property(_get_alias)             # <<<<<<<<<<<<<<
 * 
 * cdef class ScalarVariable2:
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s_get_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable);

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

  /* "pyfmi\fmi.pyx":422
 *     def __init__(self, name, value_reference, type, description = "",
 *                        variability = FMIL.fmi2_variability_enu_unknown,
 *                        causality   = FMIL.fmi2_causality_enu_unknown,             # <<<<<<<<<<<<<<
 *                        alias       = FMIL.fmi2_variable_is_not_alias,
 *                        initial     = FMIL.fmi2_initial_enu_unknown):
 */
  __pyx_t_1 = PyInt_FromLong(fmi2_causality_enu_unknown); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __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":423
 *                        variability = FMIL.fmi2_variability_enu_unknown,
 *                        causality   = FMIL.fmi2_causality_enu_unknown,
 *                        alias       = FMIL.fmi2_variable_is_not_alias,             # <<<<<<<<<<<<<<
 *                        initial     = FMIL.fmi2_initial_enu_unknown):
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi2_variable_is_not_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __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":424
 *                        causality   = FMIL.fmi2_causality_enu_unknown,
 *                        alias       = FMIL.fmi2_variable_is_not_alias,
 *                        initial     = FMIL.fmi2_initial_enu_unknown):             # <<<<<<<<<<<<<<
 * 
 *         self._name            = name
 */
  __pyx_t_1 = PyInt_FromLong(fmi2_initial_enu_unknown); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __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":444
 *         """
 *         return self._name
 *     name = property(_get_name)             # <<<<<<<<<<<<<<
 * 
 *     def _get_value_reference(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s_get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __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 = 444; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 444; __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._value_reference
 *     value_reference = property(_get_value_reference)             # <<<<<<<<<<<<<<
 * 
 *     def _get_type(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s_get_value_reference); 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, 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(__pyx_t_2); __pyx_t_2 = 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 = 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._type
 *     type = property(_get_type)             # <<<<<<<<<<<<<<
 * 
 *     def _get_description(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s_get_type); 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, 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(__pyx_t_2); __pyx_t_2 = 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 = 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._description
 *     description = property(_get_description)             # <<<<<<<<<<<<<<
 * 
 *     def _get_variability(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s_get_description); 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, 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(__pyx_t_2); __pyx_t_2 = 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 = 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":491
 *         """
 *         return self._variability
 *     variability = property(_get_variability)             # <<<<<<<<<<<<<<
 * 
 *     def _get_causality(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s_get_variability); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable2);

  /* "pyfmi\fmi.pyx":503
 *         """
 *         return self._causality
 *     causality = property(_get_causality)             # <<<<<<<<<<<<<<
 * 
 *     def _get_alias(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s_get_causality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable2);

  /* "pyfmi\fmi.pyx":515
 *         """
 *         return self._alias
 *     alias = property(_get_alias)             # <<<<<<<<<<<<<<
 * 
 *     def _get_initial(self):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s_get_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable2);

  /* "pyfmi\fmi.pyx":528
 *         """
 *         return self._initial
 *     initial = property(_get_initial)             # <<<<<<<<<<<<<<
 * 
 * cdef class FMUState2:
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s_get_initial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __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 = 528; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2->tp_dict, __pyx_n_s_initial, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __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":543
 *     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_GetModuleGlobalName(__pyx_n_s_FMI_DEFAULT_LOG_LEVEL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __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":757
 *         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 = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelBase, __pyx_n_s_get_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fget, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelBase->tp_dict, __pyx_n_s_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelBase);

  /* "pyfmi\fmi.pyx":1946
 *     #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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_DEFAULT_LOG_LEVEL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__46 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1961
 *         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_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1, __pyx_n_s_get_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1, __pyx_n_s_set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_doc_2, __pyx_kp_s_Property_for_accessing_the_curr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1961; __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_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1->tp_dict, __pyx_n_s_time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelCS1);

  /* "pyfmi\fmi.pyx":2106
 *         return FMIL.fmi1_import_get_types_platform(self._fmu)
 * 
 *     types_platform = property(fget=_get_types_platform)             # <<<<<<<<<<<<<<
 * 
 *     def get_real_status(self, status_kind):
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1, __pyx_n_s_get_types_platform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fget, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 2106; __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":2183
 *                  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 = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__57 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2391
 *     """
 * 
 *     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_GetModuleGlobalName(__pyx_n_s_FMI_DEFAULT_LOG_LEVEL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__62 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2416
 *         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 = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_get_model_types_platform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fget, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s_model_types_platform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __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":2487
 *             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_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_get_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_doc_2, __pyx_kp_s_Property_for_accessing_the_curr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __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_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s_time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __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":2518
 *             raise FMUException('Failed to set the new continuous states.')
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,             # <<<<<<<<<<<<<<
 *         doc=
 *     """
 */
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_get_continuous_states); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_set_continuous_states); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_doc_2, __pyx_kp_s_Property_for_accessing_the_curr_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2518; __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_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s_continuous_states, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2518; __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":2537
 *         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_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_get_nominal_continuous_states); 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_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __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 = PyDict_New(); 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);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_doc_2, __pyx_kp_s_Property_for_accessing_the_nomi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __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_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s_nominal_continuous_states, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME1);

  /* "pyfmi\fmi.pyx":2848
 *                  input=(),
 *                  algorithm='AssimuloFMIAlg',
 *                  options={}):             # <<<<<<<<<<<<<<
 *         """
 *         Compact function for model simulation.
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k__79 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2954
 *     FMI Model loaded from a dll.
 *     """
 *     def __init__(self, fmu, path='.', enable_logging=None, log_file_name="", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_DEFAULT_LOG_LEVEL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k__80 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":3713
 *             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_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k__121 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":5159
 *     Co-simulation model loaded from a dll
 *     """
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = "", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_DEFAULT_LOG_LEVEL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k__139 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":5243
 *         self.__t = t
 * 
 *     time = property(_get_time,_set_time, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the current time of the simulation. Calls the
 */
  __pyx_t_4 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2, __pyx_n_s_get_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2, __pyx_n_s_set_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5243; __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 = 5243; __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_doc_2, __pyx_kp_s_Property_for_accessing_the_curr_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5243; __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_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2->tp_dict, __pyx_n_s_time, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelCS2);

  /* "pyfmi\fmi.pyx":5592
 *                  input=(),
 *                  algorithm='FMICSAlg',
 *                  options={}):             # <<<<<<<<<<<<<<
 *         """
 *         Compact function for model simulation.
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k__159 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":5723
 *     """
 * 
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = "", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FMI_DEFAULT_LOG_LEVEL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k__160 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":5820
 *         self.__t = t
 * 
 *     time = property(_get_time,_set_time, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the current time of the simulation. Calls the
 */
  __pyx_t_4 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2, __pyx_n_s_get_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2, __pyx_n_s_set_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5820; __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 = 5820; __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_doc_2, __pyx_kp_s_Property_for_accessing_the_curr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5820; __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_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2->tp_dict, __pyx_n_s_time, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME2);

  /* "pyfmi\fmi.pyx":6051
 *             raise FMUException('Failed to set the new continuous states.')
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,             # <<<<<<<<<<<<<<
 *         doc=
 *     """
 */
  __pyx_t_4 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2, __pyx_n_s_get_continuous_states); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2, __pyx_n_s_set_continuous_states); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6051; __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 = 6051; __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_doc_2, __pyx_kp_s_Property_for_accessing_the_curr_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6051; __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_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2->tp_dict, __pyx_n_s_continuous_states, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME2);

  /* "pyfmi\fmi.pyx":6076
 *         return ndx
 * 
 *     nominal_continuous_states = property(_get_nominal_continuous_states, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the nominal values of the continuous states. Calls
 */
  __pyx_t_4 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2, __pyx_n_s_get_nominal_continuous_states); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6076; __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 = 6076; __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 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_doc_2, __pyx_kp_s_Property_for_accessing_the_nomi_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2->tp_dict, __pyx_n_s_nominal_continuous_states, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6076; __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":6113
 *                  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 = 6113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__172 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6245
 *         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 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_9load_fmu_deprecated, NULL, __pyx_n_s_pyfmi_fmi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_load_fmu_deprecated, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6350
 *     return model
 * 
 * def _handle_load_fmu_exception(fmu, log_file):             # <<<<<<<<<<<<<<
 *     log = []
 *     with open(log_file,'r') as file:
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_11_handle_load_fmu_exception, NULL, __pyx_n_s_pyfmi_fmi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_handle_load_fmu_exception, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6362
 *         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_GetModuleGlobalName(__pyx_n_s_FMI_DEFAULT_LOG_LEVEL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__181 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_13load_fmu, NULL, __pyx_n_s_pyfmi_fmi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_load_fmu, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6362; __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(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "..\..\..\..\Users\chria\Anaconda\envs\py34\lib\site-packages\Cython\Includes\numpy\__init__.pxd":976
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

  /*--- Wrapped vars code ---*/

  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);
  if (__pyx_m) {
    if (__pyx_d) {
      __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

static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject* args = PyTuple_Pack(1, arg);
    return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
}
#endif

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;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (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 = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

static 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,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

static PyObject* __Pyx_Globals(void) {
    Py_ssize_t i;
    PyObject *names;
    PyObject *globals = __pyx_d;
    Py_INCREF(globals);
    names = PyObject_Dir(__pyx_m);
    if (!names)
        goto bad;
    for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject* name = PySequence_GetItem(names, i);
        if (!name)
            goto bad;
#else
        PyObject* name = PyList_GET_ITEM(names, i);
#endif
        if (!PyDict_Contains(globals, name)) {
            PyObject* value = __Pyx_GetAttr(__pyx_m, name);
            if (!value) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                goto bad;
            }
            if (PyDict_SetItem(globals, name, value) < 0) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                Py_DECREF(value);
                goto bad;
            }
        }
#if CYTHON_COMPILING_IN_PYPY
        Py_DECREF(name);
#endif
    }
    Py_DECREF(names);
    return globals;
bad:
    Py_XDECREF(names);
    Py_XDECREF(globals);
    return NULL;
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        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;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                if (PyObject_IsSubclass(instance_class, type)) {
                    type = instance_class;
                } else {
                    instance_class = NULL;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        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);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            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;
    }
#endif
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_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;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(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)
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparseable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      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;
        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 != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;
        }
        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 '\r':
      case '\n':
        ++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':
        {
          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;
          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 '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          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;
        }
      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 'p':
        if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
            ctx->enc_packmode == ctx->new_packmode) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
      case 's':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->enc_count = ctx->new_count;
        ctx->enc_packmode = ctx->new_packmode;
        ctx->enc_type = *ts;
        ctx->is_complex = got_Z;
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}
static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}
static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  if (obj == Py_None || obj == NULL) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if ((unsigned)buf->itemsize != dtype->size) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  return -1;
}
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (info->buf == NULL) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}

static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        length = strlen(cstring);
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_PyObject_CallMethod1((PyObject*)&PyDict_Type, __pyx_n_s_keys, d);
    else
        return PyDict_Keys(d);
}

static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_SetString(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 void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    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 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,
                                               int is_list, int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || 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 {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return -1;
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->tp_traverse(obj, v, a);
    return 0;
}

static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module_2, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result)
        result = __Pyx_GetModuleGlobalName(name);
    return result;
}

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, (size_t)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,
        0,
        0,
        0,
        0,
        __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,
        __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;
    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_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*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 PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
    Py_DECREF(obj);
    view->obj = NULL;
}
#endif


            #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
    {                                                                     \
        func_type value = func_value;                                     \
        if (sizeof(target_type) < sizeof(func_type)) {                    \
            if (unlikely(value != (func_type) (target_type) value)) {     \
                func_type zero = 0;                                       \
                if (is_unsigned && unlikely(value < zero))                \
                    goto raise_neg_overflow;                              \
                else                                                      \
                    goto raise_overflow;                                  \
            }                                                             \
        }                                                                 \
        return (target_type) value;                                       \
    }

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif

static CYTHON_INLINE fmi1_value_reference_t __Pyx_PyInt_As_fmi1_value_reference_t(PyObject *x) {
    const fmi1_value_reference_t neg_one = (fmi1_value_reference_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(fmi1_value_reference_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(fmi1_value_reference_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (fmi1_value_reference_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(fmi1_value_reference_t, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(fmi1_value_reference_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(fmi1_value_reference_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(fmi1_value_reference_t) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(fmi1_value_reference_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(fmi1_value_reference_t,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(fmi1_value_reference_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(fmi1_value_reference_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(fmi1_value_reference_t, long, PyLong_AsLong(x))
            } else if (sizeof(fmi1_value_reference_t) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(fmi1_value_reference_t, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            fmi1_value_reference_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (fmi1_value_reference_t) -1;
        }
    } else {
        fmi1_value_reference_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (fmi1_value_reference_t) -1;
        val = __Pyx_PyInt_As_fmi1_value_reference_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to fmi1_value_reference_t");
    return (fmi1_value_reference_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to fmi1_value_reference_t");
    return (fmi1_value_reference_t) -1;
}

static CYTHON_INLINE fmi1_integer_t __Pyx_PyInt_As_fmi1_integer_t(PyObject *x) {
    const fmi1_integer_t neg_one = (fmi1_integer_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(fmi1_integer_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(fmi1_integer_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (fmi1_integer_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(fmi1_integer_t, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(fmi1_integer_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(fmi1_integer_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(fmi1_integer_t) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(fmi1_integer_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(fmi1_integer_t,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(fmi1_integer_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(fmi1_integer_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(fmi1_integer_t, long, PyLong_AsLong(x))
            } else if (sizeof(fmi1_integer_t) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(fmi1_integer_t, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            fmi1_integer_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (fmi1_integer_t) -1;
        }
    } else {
        fmi1_integer_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (fmi1_integer_t) -1;
        val = __Pyx_PyInt_As_fmi1_integer_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to fmi1_integer_t");
    return (fmi1_integer_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to fmi1_integer_t");
    return (fmi1_integer_t) -1;
}

static CYTHON_INLINE fmi2_integer_t __Pyx_PyInt_As_fmi2_integer_t(PyObject *x) {
    const fmi2_integer_t neg_one = (fmi2_integer_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(fmi2_integer_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(fmi2_integer_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (fmi2_integer_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(fmi2_integer_t, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(fmi2_integer_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(fmi2_integer_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(fmi2_integer_t) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(fmi2_integer_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(fmi2_integer_t,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(fmi2_integer_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(fmi2_integer_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(fmi2_integer_t, long, PyLong_AsLong(x))
            } else if (sizeof(fmi2_integer_t) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(fmi2_integer_t, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            fmi2_integer_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (fmi2_integer_t) -1;
        }
    } else {
        fmi2_integer_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (fmi2_integer_t) -1;
        val = __Pyx_PyInt_As_fmi2_integer_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to fmi2_integer_t");
    return (fmi2_integer_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to fmi2_integer_t");
    return (fmi2_integer_t) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        PyObject* v;
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                goto error;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            goto error;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0) {
                switch (s[len-1]) {
                    case ' ': break;
                    case '\f': case '\r': case '\n': case '\t': case '\v':
                        PyFile_SoftSpace(f, 0);
                        break;
                    default:  break;
                }
            }
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            goto error;
        PyFile_SoftSpace(f, 0);
    }
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
}
#else
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 = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItem(kwargs, __pyx_n_s_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_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            goto error;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        goto error;
    if (PyFile_WriteString("\n", f) < 0)
        goto error;
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
    /* the line below is just to avoid C compiler
     * warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_Pack(1, o);
    if (unlikely(!arg_tuple))
        return -1;
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_fmi1_value_reference_t(fmi1_value_reference_t value) {
    const fmi1_value_reference_t neg_one = (fmi1_value_reference_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(fmi1_value_reference_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(fmi1_value_reference_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(fmi1_value_reference_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(fmi1_value_reference_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(fmi1_value_reference_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(fmi1_value_reference_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong(x))
            } else if (sizeof(size_t) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
    const unsigned int neg_one = (unsigned int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_size_t(size_t value) {
    const size_t neg_one = (size_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(size_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(size_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(size_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(size_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(size_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_fmi1_boolean_t(fmi1_boolean_t value) {
    const fmi1_boolean_t neg_one = (fmi1_boolean_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(fmi1_boolean_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(fmi1_boolean_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(fmi1_boolean_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(fmi1_boolean_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(fmi1_boolean_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(fmi1_boolean_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_fmi1_integer_t(fmi1_integer_t value) {
    const fmi1_integer_t neg_one = (fmi1_integer_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(fmi1_integer_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(fmi1_integer_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(fmi1_integer_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(fmi1_integer_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(fmi1_integer_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(fmi1_integer_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE fmi2_boolean_t __Pyx_PyInt_As_fmi2_boolean_t(PyObject *x) {
    const fmi2_boolean_t neg_one = (fmi2_boolean_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(fmi2_boolean_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(fmi2_boolean_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (fmi2_boolean_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(fmi2_boolean_t, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(fmi2_boolean_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(fmi2_boolean_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(fmi2_boolean_t) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(fmi2_boolean_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(fmi2_boolean_t,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(fmi2_boolean_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(fmi2_boolean_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(fmi2_boolean_t, long, PyLong_AsLong(x))
            } else if (sizeof(fmi2_boolean_t) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(fmi2_boolean_t, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            fmi2_boolean_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (fmi2_boolean_t) -1;
        }
    } else {
        fmi2_boolean_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (fmi2_boolean_t) -1;
        val = __Pyx_PyInt_As_fmi2_boolean_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to fmi2_boolean_t");
    return (fmi2_boolean_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to fmi2_boolean_t");
    return (fmi2_boolean_t) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_fmi2_boolean_t(fmi2_boolean_t value) {
    const fmi2_boolean_t neg_one = (fmi2_boolean_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(fmi2_boolean_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(fmi2_boolean_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(fmi2_boolean_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(fmi2_boolean_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(fmi2_boolean_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(fmi2_boolean_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_fmi2_integer_t(fmi2_integer_t value) {
    const fmi2_integer_t neg_one = (fmi2_integer_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(fmi2_integer_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(fmi2_integer_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(fmi2_integer_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(fmi2_integer_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(fmi2_integer_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        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 long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -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);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

static int __Pyx_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
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if !CYTHON_COMPILING_IN_PYPY
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
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_MAJOR_VERSION < 3
  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_MAJOR_VERSION < 3
  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_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (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;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b)))
      return PyInt_AS_LONG(b);
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
     #if CYTHON_USE_PYLONG_INTERNALS
       switch (Py_SIZE(b)) {
       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
       case  0: return 0;
       case  1: return ((PyLongObject*)b)->ob_digit[0];
       }
     #endif
    #endif
    return PyLong_AsSsize_t(b);
  }
  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) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
