/* Generated by Cython 0.16 on Tue Jan 29 16:07:09 2013 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02040000
    #error Cython requires Python 2.4+.
#else
#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif

#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif

#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif

#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif

#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif

#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif

#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyCFunction_Call PyObject_Call
#else
  #define __Pyx_PyCFunction_Call PyCFunction_Call
#endif

#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
#endif

#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)

  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;

  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)

  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif

#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif

#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif

#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif

#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif


#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_GET_LENGTH)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif

#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)

#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif

#if PY_VERSION_HEX < 0x03020000
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif

#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif

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

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

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

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif


/* inline attribute */
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif

typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/


/* Type Conversion Predeclarations */

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))

#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))

#ifdef __GNUC__
  /* Test for GCC > 2.95 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;

#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif


static const char *__pyx_f[] = {
  "fmi.pyx",
  "numpy.pxd",
};
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name; /* for error messages only */
  struct __Pyx_StructField_* fields;
  size_t size;     /* sizeof(type) */
  size_t arraysize[8]; /* length of array in each dimension */
  int ndim;
  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject */
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;


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

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

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

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

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

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

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

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

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

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

/* "numpy.pxd":746
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

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

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

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

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

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

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

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

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

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

/* "numpy.pxd":759
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif

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


/*--- Type declarations ---*/
struct __pyx_obj_5pyfmi_3fmi_BaseModel;
struct __pyx_obj_5pyfmi_3fmi_FMUModelBase;
struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1;
struct __pyx_obj_5pyfmi_3fmi_FMUModelME1;
struct __pyx_obj_5pyfmi_3fmi_FMUModel;
struct __pyx_obj_5pyfmi_3fmi_ScalarVariable;

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

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

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

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

/* "pyfmi\fmi.pyx":115
 *     print "FMU: fmiStatus = %d;  %s (%s): %s\n"%(status, instanceName, category, buf)
 * 
 * cdef class BaseModel:             # <<<<<<<<<<<<<<
 *     """
 *     Abstract Model class containing base functionality.
 */
struct __pyx_obj_5pyfmi_3fmi_BaseModel {
  PyObject_HEAD
};


/* "pyfmi\fmi.pyx":365
 * 
 * 
 * cdef class FMUModelBase(BaseModel):             # <<<<<<<<<<<<<<
 *     """
 *     An FMI Model loaded from a DLL.
 */
struct __pyx_obj_5pyfmi_3fmi_FMUModelBase {
  struct __pyx_obj_5pyfmi_3fmi_BaseModel __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;
  PyObject *_allocated_dll;
  PyObject *_allocated_context;
  PyObject *_allocated_xml;
  PyObject *_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;
  PyObject *_fmu_temp_dir;
  int _fmu_kind;
};


/* "pyfmi\fmi.pyx":1620
 * 
 * 
 * cdef class FMUModelCS1(FMUModelBase):             # <<<<<<<<<<<<<<
 *     #First step only support fmi1_fmu_kind_enu_cs_standalone
 *     #stepFinished not supported
 */
struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase __pyx_base;
};


/* "pyfmi\fmi.pyx":2030
 *         return capabilities
 * 
 * cdef class FMUModelME1(FMUModelBase):             # <<<<<<<<<<<<<<
 *     """
 *     An FMI Model loaded from a DLL.
 */
struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase __pyx_base;
};


/* "pyfmi\fmi.pyx":2583
 * 
 * #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":257
 *     pass
 * 
 * cdef class ScalarVariable:             # <<<<<<<<<<<<<<
 *     """
 *     Class defining data structure based on the XML element ScalarVariable.
 */
struct __pyx_obj_5pyfmi_3fmi_ScalarVariable {
  PyObject_HEAD
  PyObject *_name;
  fmi1_value_reference_t _value_reference;
  PyObject *_description;
  enum fmi1_base_type_enu_t _type;
  enum fmi1_variability_enu_t _variability;
  enum fmi1_causality_enu_t _causality;
  enum fmi1_variable_alias_kind_enu_t _alias;
};



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


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

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


/* "pyfmi\fmi.pyx":1620
 * 
 * 
 * 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;
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          if (acquire_gil) { \
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
              PyGILState_Release(__pyx_gilstate_save); \
          } else { \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext() \
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/

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

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

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

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

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

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (likely(i >= 0)) {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            return m->sq_item(o, i);
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

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

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

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

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

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

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

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

typedef struct {
  Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
  size_t refcount;
  Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
  __Pyx_Buffer *rcbuffer;
  char *data;
  __Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;

#if PY_MAJOR_VERSION < 3
    static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
    static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
    #define __Pyx_GetBuffer PyObject_GetBuffer
    #define __Pyx_ReleaseBuffer PyBuffer_Release
#endif

static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};

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

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/

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

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

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

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/

static CYTHON_INLINE fmi1_value_reference_t __Pyx_PyInt_from_py_fmi1_value_reference_t(PyObject *);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_value_reference_t(fmi1_value_reference_t);

static CYTHON_INLINE size_t __Pyx_PyInt_from_py_size_t(PyObject *);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_size_t(size_t);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_boolean_t(fmi1_boolean_t);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_integer_t(fmi1_integer_t);

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

static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

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

static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

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

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

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

static CYTHON_INLINE fmi1_integer_t __Pyx_PyInt_from_py_fmi1_integer_t(PyObject *);

static int __Pyx_check_binary_version(void);

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

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

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

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/


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

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

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

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

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

/* Module declarations from 'numpy' */

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

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

/* Module declarations from 'pyfmi.fmi' */
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_BaseModel = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_ScalarVariable = 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_FMUModel = 0;
static void __pyx_f_5pyfmi_3fmi_importlogger(struct jm_callbacks *, jm_string, int, jm_string); /*proto*/
static void __pyx_f_5pyfmi_3fmi_importlogger_load_fmu(struct jm_callbacks *, jm_string, int, jm_string); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn_fmi1_value_reference_t = { "fmi1_value_reference_t", NULL, sizeof(fmi1_value_reference_t), { 0 }, 0, 'U', IS_UNSIGNED(fmi1_value_reference_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn_fmi1_real_t = { "fmi1_real_t", NULL, sizeof(fmi1_real_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn_fmi1_integer_t = { "fmi1_integer_t", NULL, sizeof(fmi1_integer_t), { 0 }, 0, 'I', IS_UNSIGNED(fmi1_integer_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
#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_basestring;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_pf_5pyfmi_3fmi_9BaseModel_set(struct __pyx_obj_5pyfmi_3fmi_BaseModel *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9BaseModel_2get(struct __pyx_obj_5pyfmi_3fmi_BaseModel *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9BaseModel_4_exec_algorithm(struct __pyx_obj_5pyfmi_3fmi_BaseModel *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9BaseModel_6_exec_simulate_algorithm(struct __pyx_obj_5pyfmi_3fmi_BaseModel *__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_9BaseModel_8_default_options(struct __pyx_obj_5pyfmi_3fmi_BaseModel *__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_12FMUModelBase___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_2get_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_4print_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_6_get_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8get_ode_sizes(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_10get_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12set_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_14get_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_16set_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_18get_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_20set_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_22get_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_24set_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_26set_debug_logging(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_28set_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_30_set(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variable_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_32_get(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_34get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_36get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_38get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_40get_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_42get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_44get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_46get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_50save_time_point(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_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); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_56get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_58get_variable_by_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, fmi1_value_reference_t __pyx_v_valueref, PyObject *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_60get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_62get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_64get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_66get_author(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_68get_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_70get_generation_tool(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_72get_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 PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_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); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_2_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_4_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_t); /* proto */
static void __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_6__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_8do_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_current_t, fmi1_real_t __pyx_v_step_size, PyObject *__pyx_v_new_step); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_10cancel_step(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_variables, fmi1_integer_t __pyx_v_order); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_14_get_types_platform(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_16set_input_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_values, fmi1_integer_t __pyx_v_order); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_18simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_20simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_22initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_tStart, PyObject *__pyx_v_tStop, PyObject *__pyx_v_StopTimeDefined); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_24instantiate_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_26get_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); /* 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_8FMUModel___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModel *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_load_fmu(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging); /* proto */
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
static char __pyx_k_1[] = "FMIL: module = %s, log level = %d: %s";
static char __pyx_k_2[] = "FMU: fmiStatus = %d;  %s (%s): %s\n";
static char __pyx_k_3[] = "common.algorithm_drivers";
static char __pyx_k_4[] = " must be a subclass of common.algorithm_drivers.AlgorithmBase";
static char __pyx_k_5[] = "";
static char __pyx_k_9[] = ".";
static char __pyx_k_11[] = ".fmu";
static char __pyx_k_13[] = "FMUModel must be instantiated with an FMU (.fmu) file.";
static char __pyx_k_15[] = "The FMU version could not be determined. ";
static char __pyx_k_16[] = "The FMU version could not be determined. Enable logging for possibly more information.";
static char __pyx_k_18[] = "PyFMI currently only supports FMI 1.0.";
static char __pyx_k_20[] = "PyFMI currently only supports FMI 1.0 for Model Exchange.";
static char __pyx_k_22[] = "FMI_REGISTER_GLOBALLY";
static char __pyx_k_23[] = "Error loading the binary. Enable logging for possibly more information.";
static char __pyx_k_25[] = "Failed to get the Real values.";
static char __pyx_k_27[] = "The length of valueref and values are inconsistent.";
static char __pyx_k_29[] = "Failed to set the Real values.";
static char __pyx_k_31[] = "Failed to get the Integer values.";
static char __pyx_k_34[] = "Failed to set the Integer values.";
static char __pyx_k_36[] = "Failed to get the Boolean values.";
static char __pyx_k_39[] = "Failed to set the Boolean values.";
static char __pyx_k_41[] = "Failed to set the debugging option.";
static char __pyx_k_43[] = "Invalid log level for FMI Library (0-7).";
static char __pyx_k_45[] = "Type not supported.";
static char __pyx_k_48[] = "get_variable_description";
static char __pyx_k_49[] = "The variable %s could not be found.";
static char __pyx_k_50[] = "get_variable_data_type";
static char __pyx_k_51[] = "get_variable_valueref";
static char __pyx_k_52[] = "The variable with value reference: %s, could not be found.";
static char __pyx_k_53[] = "Either provide value reference or variable name.";
static char __pyx_k_55[] = "The variable is not a real variable.";
static char __pyx_k_57[] = "The variable %s does not have a start value.";
static char __pyx_k_58[] = "Unknown variable type.";
static char __pyx_k_60[] = "The variable type does not have a maximum value.";
static char __pyx_k_62[] = "The variable type does not have a minimum value.";
static char __pyx_k_67[] = "get_variable_variability";
static char __pyx_k_68[] = "The variable with the valuref %i could not be found.";
static char __pyx_k_69[] = "get_variable_causality";
static char __pyx_k_71[] = "This class only supports FMI 1.0 for Co-simulation.";
static char __pyx_k_74[] = "The order must be greater than zero and below the maximum output derivative support of the FMU (%d).";
static char __pyx_k_75[] = "The variables must either be a string or a list of strings";
static char __pyx_k_77[] = "Failed to get the Real output derivatives.";
static char __pyx_k_79[] = "The order must be greater than zero.";
static char __pyx_k_81[] = "The FMU does not support input derivatives.";
static char __pyx_k_84[] = "Failed to set the Real input derivatives.";
static char __pyx_k_89[] = "_exec_simulate_algorithm";
static char __pyx_k_90[] = "pyfmi.fmi_algorithm_drivers";
static char __pyx_k_94[] = "The slave failed to initialize.";
static char __pyx_k_97[] = "FMI_MIME_CS_STANDALONE";
static char __pyx_k_98[] = "Failed to instantiate the slave.";
static char __pyx_k__B[] = "B";
static char __pyx_k__H[] = "H";
static char __pyx_k__I[] = "I";
static char __pyx_k__L[] = "L";
static char __pyx_k__N[] = "N";
static char __pyx_k__O[] = "O";
static char __pyx_k__Q[] = "Q";
static char __pyx_k__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_101[] = "canHandleVariableCommunicationStepSize";
static char __pyx_k_102[] = "canInterpolateInputs";
static char __pyx_k_103[] = "maxOutputDerivativeOrder";
static char __pyx_k_104[] = "canRunAsynchronuously";
static char __pyx_k_105[] = "canBeInstantiatedOnlyOncePerProcess";
static char __pyx_k_106[] = "canNotUseMemoryManagementFunctions";
static char __pyx_k_108[] = "This class only supports FMI 1.0 for Model Exchange.";
static char __pyx_k_110[] = "The DLL could not be reloaded, check the log for more information.";
static char __pyx_k_112[] = "Failed to set the time.";
static char __pyx_k_114[] = "Failed to retrieve the continuous states.";
static char __pyx_k_116[] = "Failed to set the new continuous states. The number of values are not consistent with the number of continuous states.";
static char __pyx_k_118[] = "Failed to set the new continuous states.";
static char __pyx_k_120[] = "Failed to get the nominal values.";
static char __pyx_k_122[] = "Failed to get the derivative values.";
static char __pyx_k_124[] = "Failed to get the event indicators.";
static char __pyx_k_126[] = "nominal_continuous_states";
static char __pyx_k_128[] = "Failed to update the events.";
static char __pyx_k_130[] = "stateValueReferencesChanged";
static char __pyx_k_131[] = "Failed to get the continuous state reference values.";
static char __pyx_k_133[] = "Failed to call FMI Completed Step.";
static char __pyx_k_136[] = "Initialize returned with a warning. Check the log for information (FMUModel.get_log).";
static char __pyx_k_138[] = "Initialize returned with a warning. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_140[] = "Initialize returned with a error. Check the log for information (FMUModel.get_log).";
static char __pyx_k_142[] = "Initialize returned with a error. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_145[] = "Failed to instantiate the model.";
static char __pyx_k_152[] = "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_159[] = "ndarray is not C contiguous";
static char __pyx_k_161[] = "ndarray is not Fortran contiguous";
static char __pyx_k_163[] = "Non-native byte order not supported";
static char __pyx_k_165[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_166[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_169[] = "Format string allocated too short.";
static char __pyx_k_171[] = "\nModule containing the FMI interface Python wrappers.\n";
static char __pyx_k_172[] = "pyfmi.common.core";
static char __pyx_k_173[] = "\001";
static char __pyx_k_174[] = "\000";
static char __pyx_k_175[] = "application/x-fmu-sharedlibrary";
static char __pyx_k_176[] = "\n    An FMU exception.\n    ";
static char __pyx_k_177[] = "pyfmi.fmi";
static char __pyx_k_178[] = "_get_value_reference";
static char __pyx_k_179[] = "\n    Property for accessing the current time of the simulation. Calls the \n    low-level FMI function: fmiSetTime.\n    ";
static char __pyx_k_180[] = "_get_model_types_platform";
static char __pyx_k_181[] = "model_types_platform";
static char __pyx_k_182[] = "_get_continuous_states";
static char __pyx_k_183[] = "_set_continuous_states";
static char __pyx_k_184[] = "\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_185[] = "_get_nominal_continuous_states";
static char __pyx_k_186[] = "\n    Property for accessing the nominal values of the continuous states. Calls \n    the low-level FMI function: fmiGetNominalContinuousStates.\n    ";
static char __pyx_k_189[] = "C:\\Development\\PyFMI\\branches\\PyFMI-1.2.x\\src\\pyfmi\\fmi.pyx";
static char __pyx_k__Zd[] = "Zd";
static char __pyx_k__Zf[] = "Zf";
static char __pyx_k__Zg[] = "Zg";
static char __pyx_k__os[] = "os";
static char __pyx_k__alg[] = "alg";
static char __pyx_k__doc[] = "doc";
static char __pyx_k__fmu[] = "fmu";
static char __pyx_k__int[] = "int";
static char __pyx_k__sys[] = "sys";
static char __pyx_k___fmu[] = "_fmu";
static char __pyx_k___get[] = "_get";
static char __pyx_k___set[] = "_set";
static char __pyx_k__fget[] = "fget";
static char __pyx_k__join[] = "join";
static char __pyx_k__name[] = "name";
static char __pyx_k__path[] = "path";
static char __pyx_k__self[] = "self";
static char __pyx_k__size[] = "size";
static char __pyx_k__time[] = "time";
static char __pyx_k__type[] = "type";
static char __pyx_k__Model[] = "Model";
static char __pyx_k__Slave[] = "Slave";
static char __pyx_k__alias[] = "alias";
static char __pyx_k__array[] = "array";
static char __pyx_k__dtype[] = "dtype";
static char __pyx_k__empty[] = "empty";
static char __pyx_k__float[] = "float";
static char __pyx_k__input[] = "input";
static char __pyx_k__int32[] = "int32";
static char __pyx_k__model[] = "model";
static char __pyx_k__ndmin[] = "ndmin";
static char __pyx_k__numpy[] = "numpy";
static char __pyx_k__order[] = "order";
static char __pyx_k__range[] = "range";
static char __pyx_k__solve[] = "solve";
static char __pyx_k__tStop[] = "tStop";
static char __pyx_k__value[] = "value";
static char __pyx_k__zeros[] = "zeros";
static char __pyx_k__FMI_ME[] = "FMI_ME";
static char __pyx_k__FMI_OK[] = "FMI_OK";
static char __pyx_k__double[] = "double";
static char __pyx_k__module[] = "module";
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__abspath[] = "abspath";
static char __pyx_k__context[] = "context";
static char __pyx_k__flatten[] = "flatten";
static char __pyx_k__logging[] = "logging";
static char __pyx_k__options[] = "options";
static char __pyx_k__version[] = "version";
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____init__[] = "__init__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__algdrive[] = "algdrive";
static char __pyx_k__endswith[] = "endswith";
static char __pyx_k__fmu_kind[] = "fmu_kind";
static char __pyx_k__get_real[] = "get_real";
static char __pyx_k__load_fmu[] = "load_fmu";
static char __pyx_k__new_step[] = "new_step";
static char __pyx_k__property[] = "property";
static char __pyx_k__set_real[] = "set_real";
static char __pyx_k__valueref[] = "valueref";
static char __pyx_k__Exception[] = "Exception";
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___get_name[] = "_get_name";
static char __pyx_k___get_time[] = "_get_time";
static char __pyx_k___get_type[] = "_get_type";
static char __pyx_k___set_time[] = "_set_time";
static char __pyx_k__algorithm[] = "algorithm";
static char __pyx_k__base_path[] = "base_path";
static char __pyx_k__callbacks[] = "callbacks";
static char __pyx_k__causality[] = "causality";
static char __pyx_k__current_t[] = "current_t";
static char __pyx_k__step_size[] = "step_size";
static char __pyx_k__variables[] = "variables";
static char __pyx_k__FMI_INPUTS[] = "FMI_INPUTS";
static char __pyx_k__FMI_OUTPUT[] = "FMI_OUTPUT";
static char __pyx_k__FMI_STATES[] = "FMI_STATES";
static char __pyx_k__FMI_STRING[] = "FMI_STRING";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k____import__[] = "__import__";
static char __pyx_k___get_alias[] = "_get_alias";
static char __pyx_k__basestring[] = "basestring";
static char __pyx_k__final_time[] = "final_time";
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__only_fixed[] = "only_fixed";
static char __pyx_k__only_start[] = "only_start";
static char __pyx_k__set_string[] = "set_string";
static char __pyx_k__start_time[] = "start_time";
static char __pyx_k__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__PyEventInfo[] = "PyEventInfo";
static char __pyx_k__description[] = "description";
static char __pyx_k__get_boolean[] = "get_boolean";
static char __pyx_k__get_integer[] = "get_integer";
static char __pyx_k__set_boolean[] = "set_boolean";
static char __pyx_k__set_integer[] = "set_integer";
static char __pyx_k__variability[] = "variability";
static char __pyx_k__FMI_CONSTANT[] = "FMI_CONSTANT";
static char __pyx_k__FMI_DISCRETE[] = "FMI_DISCRETE";
static char __pyx_k__FMI_INTERNAL[] = "FMI_INTERNAL";
static char __pyx_k__FMI_NO_ALIAS[] = "FMI_NO_ALIAS";
static char __pyx_k__FMUException[] = "FMUException";
static char __pyx_k__RuntimeError[] = "RuntimeError";
static char __pyx_k___get_version[] = "_get_version";
static char __pyx_k__fmu_temp_dir[] = "fmu_temp_dir";
static char __pyx_k__variablename[] = "variablename";
static char __pyx_k__AlgorithmBase[] = "AlgorithmBase";
static char __pyx_k__FMI_PARAMETER[] = "FMI_PARAMETER";
static char __pyx_k__allocated_xml[] = "allocated_xml";
static char __pyx_k__fmu_full_path[] = "fmu_full_path";
static char __pyx_k__include_alias[] = "include_alias";
static char __pyx_k__nextEventTime[] = "nextEventTime";
static char __pyx_k__tolControlled[] = "tolControlled";
static char __pyx_k__variable_name[] = "variable_name";
static char __pyx_k__AssimuloFMIAlg[] = "AssimuloFMIAlg";
static char __pyx_k__FMI_CONTINUOUS[] = "FMI_CONTINUOUS";
static char __pyx_k___get_causality[] = "_get_causality";
static char __pyx_k__canRejectSteps[] = "canRejectSteps";
static char __pyx_k__enable_logging[] = "enable_logging";
static char __pyx_k__types_platform[] = "types_platform";
static char __pyx_k__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__delete_temp_dir[] = "delete_temp_dir";
static char __pyx_k__get_derivatives[] = "get_derivatives";
static char __pyx_k__value_reference[] = "value_reference";
static char __pyx_k___default_options[] = "_default_options";
static char __pyx_k___get_description[] = "_get_description";
static char __pyx_k___get_variability[] = "_get_variability";
static char __pyx_k__get_variable_max[] = "get_variable_max";
static char __pyx_k__get_variable_min[] = "get_variable_min";
static char __pyx_k__FMI_CS_STANDALONE[] = "FMI_CS_STANDALONE";
static char __pyx_k__FMI_NEGATED_ALIAS[] = "FMI_NEGATED_ALIAS";
static char __pyx_k__algorithm_drivers[] = "algorithm_drivers";
static char __pyx_k__allocated_context[] = "allocated_context";
static char __pyx_k__callBackFunctions[] = "callBackFunctions";
static char __pyx_k__continuous_states[] = "continuous_states";
static char __pyx_k__instantiate_model[] = "instantiate_model";
static char __pyx_k__instantiate_slave[] = "instantiate_slave";
static char __pyx_k__relativeTolerance[] = "relativeTolerance";
static char __pyx_k__upcomingTimeEvent[] = "upcomingTimeEvent";
static char __pyx_k__get_variable_fixed[] = "get_variable_fixed";
static char __pyx_k__get_variable_start[] = "get_variable_start";
static char __pyx_k__intermediateResult[] = "intermediateResult";
static char __pyx_k__iterationConverged[] = "iterationConverged";
static char __pyx_k__stateValuesChanged[] = "stateValuesChanged";
static char __pyx_k__NotImplementedError[] = "NotImplementedError";
static char __pyx_k___get_types_platform[] = "_get_types_platform";
static char __pyx_k__get_default_options[] = "get_default_options";
static char __pyx_k__get_model_variables[] = "get_model_variables";
static char __pyx_k__terminateSimulation[] = "terminateSimulation";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_n_s_101;
static PyObject *__pyx_n_s_102;
static PyObject *__pyx_n_s_103;
static PyObject *__pyx_n_s_104;
static PyObject *__pyx_n_s_105;
static PyObject *__pyx_n_s_106;
static PyObject *__pyx_kp_s_108;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_kp_s_110;
static PyObject *__pyx_kp_s_112;
static PyObject *__pyx_kp_s_114;
static PyObject *__pyx_kp_s_116;
static PyObject *__pyx_kp_s_118;
static PyObject *__pyx_kp_s_120;
static PyObject *__pyx_kp_s_122;
static PyObject *__pyx_kp_s_124;
static PyObject *__pyx_n_s_126;
static PyObject *__pyx_kp_s_128;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_n_s_130;
static PyObject *__pyx_kp_s_131;
static PyObject *__pyx_kp_s_133;
static PyObject *__pyx_kp_s_136;
static PyObject *__pyx_kp_s_138;
static PyObject *__pyx_kp_s_140;
static PyObject *__pyx_kp_s_142;
static PyObject *__pyx_kp_s_145;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_152;
static PyObject *__pyx_kp_u_159;
static PyObject *__pyx_kp_s_16;
static PyObject *__pyx_kp_u_161;
static PyObject *__pyx_kp_u_163;
static PyObject *__pyx_kp_u_165;
static PyObject *__pyx_kp_u_166;
static PyObject *__pyx_kp_u_169;
static PyObject *__pyx_n_s_172;
static PyObject *__pyx_kp_s_173;
static PyObject *__pyx_kp_s_174;
static PyObject *__pyx_kp_s_175;
static PyObject *__pyx_kp_s_176;
static PyObject *__pyx_n_s_177;
static PyObject *__pyx_n_s_178;
static PyObject *__pyx_kp_s_179;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_n_s_180;
static PyObject *__pyx_n_s_181;
static PyObject *__pyx_n_s_182;
static PyObject *__pyx_n_s_183;
static PyObject *__pyx_kp_s_184;
static PyObject *__pyx_n_s_185;
static PyObject *__pyx_kp_s_186;
static PyObject *__pyx_kp_s_189;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_n_s_22;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_kp_s_41;
static PyObject *__pyx_kp_s_43;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_n_s_48;
static PyObject *__pyx_kp_s_49;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_n_s_50;
static PyObject *__pyx_n_s_51;
static PyObject *__pyx_kp_s_52;
static PyObject *__pyx_kp_s_53;
static PyObject *__pyx_kp_s_55;
static PyObject *__pyx_kp_s_57;
static PyObject *__pyx_kp_s_58;
static PyObject *__pyx_kp_s_60;
static PyObject *__pyx_kp_s_62;
static PyObject *__pyx_n_s_67;
static PyObject *__pyx_kp_s_68;
static PyObject *__pyx_n_s_69;
static PyObject *__pyx_kp_s_71;
static PyObject *__pyx_kp_s_74;
static PyObject *__pyx_kp_s_75;
static PyObject *__pyx_kp_s_77;
static PyObject *__pyx_kp_s_79;
static PyObject *__pyx_kp_s_81;
static PyObject *__pyx_kp_s_84;
static PyObject *__pyx_n_s_89;
static PyObject *__pyx_kp_s_9;
static PyObject *__pyx_kp_s_90;
static PyObject *__pyx_kp_s_94;
static PyObject *__pyx_n_s_97;
static PyObject *__pyx_kp_s_98;
static PyObject *__pyx_n_s__AlgorithmBase;
static PyObject *__pyx_n_s__AssimuloFMIAlg;
static PyObject *__pyx_n_s__Exception;
static PyObject *__pyx_n_s__FMICSAlg;
static PyObject *__pyx_n_s__FMI_ALIAS;
static PyObject *__pyx_n_s__FMI_BOOLEAN;
static PyObject *__pyx_n_s__FMI_CONSTANT;
static PyObject *__pyx_n_s__FMI_CONTINUOUS;
static PyObject *__pyx_n_s__FMI_CS_STANDALONE;
static PyObject *__pyx_n_s__FMI_DERIVATIVES;
static PyObject *__pyx_n_s__FMI_DISCARD;
static PyObject *__pyx_n_s__FMI_DISCRETE;
static PyObject *__pyx_n_s__FMI_ENUMERATION;
static PyObject *__pyx_n_s__FMI_ERROR;
static PyObject *__pyx_n_s__FMI_FALSE;
static PyObject *__pyx_n_s__FMI_FATAL;
static PyObject *__pyx_n_s__FMI_INPUT;
static PyObject *__pyx_n_s__FMI_INPUTS;
static PyObject *__pyx_n_s__FMI_INTEGER;
static PyObject *__pyx_n_s__FMI_INTERNAL;
static PyObject *__pyx_n_s__FMI_ME;
static PyObject *__pyx_n_s__FMI_NEGATED_ALIAS;
static PyObject *__pyx_n_s__FMI_NONE;
static PyObject *__pyx_n_s__FMI_NO_ALIAS;
static PyObject *__pyx_n_s__FMI_OK;
static PyObject *__pyx_n_s__FMI_OUTPUT;
static PyObject *__pyx_n_s__FMI_OUTPUTS;
static PyObject *__pyx_n_s__FMI_PARAMETER;
static PyObject *__pyx_n_s__FMI_PENDING;
static PyObject *__pyx_n_s__FMI_REAL;
static PyObject *__pyx_n_s__FMI_STATES;
static PyObject *__pyx_n_s__FMI_STRING;
static PyObject *__pyx_n_s__FMI_TRUE;
static PyObject *__pyx_n_s__FMI_WARNING;
static PyObject *__pyx_n_s__FMUException;
static PyObject *__pyx_n_s__Model;
static PyObject *__pyx_n_s__N;
static PyObject *__pyx_n_s__NotImplementedError;
static PyObject *__pyx_n_s__PyEventInfo;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__Slave;
static PyObject *__pyx_n_s__StopTimeDefined;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s____import__;
static PyObject *__pyx_n_s____init__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___default_options;
static PyObject *__pyx_n_s___fmu;
static PyObject *__pyx_n_s___get;
static PyObject *__pyx_n_s___get_alias;
static PyObject *__pyx_n_s___get_causality;
static PyObject *__pyx_n_s___get_description;
static PyObject *__pyx_n_s___get_name;
static PyObject *__pyx_n_s___get_time;
static PyObject *__pyx_n_s___get_type;
static PyObject *__pyx_n_s___get_types_platform;
static PyObject *__pyx_n_s___get_variability;
static PyObject *__pyx_n_s___get_version;
static PyObject *__pyx_n_s___set;
static PyObject *__pyx_n_s___set_time;
static PyObject *__pyx_n_s__abspath;
static PyObject *__pyx_n_s__alg;
static PyObject *__pyx_n_s__algdrive;
static PyObject *__pyx_n_s__algorithm;
static PyObject *__pyx_n_s__algorithm_drivers;
static PyObject *__pyx_n_s__alias;
static PyObject *__pyx_n_s__allocated_context;
static PyObject *__pyx_n_s__allocated_xml;
static PyObject *__pyx_n_s__array;
static PyObject *__pyx_n_s__base_path;
static PyObject *__pyx_n_s__basestring;
static PyObject *__pyx_n_s__callBackFunctions;
static PyObject *__pyx_n_s__callbacks;
static PyObject *__pyx_n_s__canHandleEvents;
static PyObject *__pyx_n_s__canRejectSteps;
static PyObject *__pyx_n_s__canSignalEvents;
static PyObject *__pyx_n_s__causality;
static PyObject *__pyx_n_s__context;
static PyObject *__pyx_n_s__continuous_states;
static PyObject *__pyx_n_s__create_temp_dir;
static PyObject *__pyx_n_s__current_t;
static PyObject *__pyx_n_s__delete_temp_dir;
static PyObject *__pyx_n_s__description;
static PyObject *__pyx_n_s__doc;
static PyObject *__pyx_n_s__double;
static PyObject *__pyx_n_s__dtype;
static PyObject *__pyx_n_s__empty;
static PyObject *__pyx_n_s__enable_logging;
static PyObject *__pyx_n_s__endswith;
static PyObject *__pyx_n_s__fget;
static PyObject *__pyx_n_s__final_time;
static PyObject *__pyx_n_s__flatten;
static PyObject *__pyx_n_s__float;
static PyObject *__pyx_n_s__fmu;
static PyObject *__pyx_n_s__fmu_full_path;
static PyObject *__pyx_n_s__fmu_kind;
static PyObject *__pyx_n_s__fmu_temp_dir;
static PyObject *__pyx_n_s__get_boolean;
static PyObject *__pyx_n_s__get_default_options;
static PyObject *__pyx_n_s__get_derivatives;
static PyObject *__pyx_n_s__get_integer;
static PyObject *__pyx_n_s__get_model_variables;
static PyObject *__pyx_n_s__get_real;
static PyObject *__pyx_n_s__get_result;
static PyObject *__pyx_n_s__get_string;
static PyObject *__pyx_n_s__get_variable_fixed;
static PyObject *__pyx_n_s__get_variable_max;
static PyObject *__pyx_n_s__get_variable_min;
static PyObject *__pyx_n_s__get_variable_start;
static PyObject *__pyx_n_s__include_alias;
static PyObject *__pyx_n_s__input;
static PyObject *__pyx_n_s__instantiate_model;
static PyObject *__pyx_n_s__instantiate_slave;
static PyObject *__pyx_n_s__int;
static PyObject *__pyx_n_s__int32;
static PyObject *__pyx_n_s__intermediateResult;
static PyObject *__pyx_n_s__iterationConverged;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__last_error;
static PyObject *__pyx_n_s__load_fmu;
static PyObject *__pyx_n_s__logging;
static PyObject *__pyx_n_s__model;
static PyObject *__pyx_n_s__module;
static PyObject *__pyx_n_s__name;
static PyObject *__pyx_n_s__ndmin;
static PyObject *__pyx_n_s__new_step;
static PyObject *__pyx_n_s__nextEventTime;
static PyObject *__pyx_n_s__numpy;
static PyObject *__pyx_n_s__only_fixed;
static PyObject *__pyx_n_s__only_start;
static PyObject *__pyx_n_s__options;
static PyObject *__pyx_n_s__order;
static PyObject *__pyx_n_s__os;
static PyObject *__pyx_n_s__path;
static PyObject *__pyx_n_s__property;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__relativeTolerance;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__set_boolean;
static PyObject *__pyx_n_s__set_integer;
static PyObject *__pyx_n_s__set_real;
static PyObject *__pyx_n_s__set_string;
static PyObject *__pyx_n_s__size;
static PyObject *__pyx_n_s__solve;
static PyObject *__pyx_n_s__start_time;
static PyObject *__pyx_n_s__stateValuesChanged;
static PyObject *__pyx_n_s__step_size;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__tStart;
static PyObject *__pyx_n_s__tStop;
static PyObject *__pyx_n_s__terminateSimulation;
static PyObject *__pyx_n_s__time;
static PyObject *__pyx_n_s__tolControlled;
static PyObject *__pyx_n_s__type;
static PyObject *__pyx_n_s__types_platform;
static PyObject *__pyx_n_s__uint32;
static PyObject *__pyx_n_s__upcomingTimeEvent;
static PyObject *__pyx_n_s__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__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__warning;
static PyObject *__pyx_n_s__xrange;
static PyObject *__pyx_n_s__zeros;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_15;
static PyObject *__pyx_k_6;
static PyObject *__pyx_k_7;
static PyObject *__pyx_k_8;
static PyObject *__pyx_k_10;
static PyObject *__pyx_k_64;
static PyObject *__pyx_k_65;
static PyObject *__pyx_k_66;
static PyObject *__pyx_k_70;
static PyObject *__pyx_k_73;
static PyObject *__pyx_k_86;
static PyObject *__pyx_k_87;
static PyObject *__pyx_k_88;
static PyObject *__pyx_k_91;
static PyObject *__pyx_k_92;
static PyObject *__pyx_k_93;
static PyObject *__pyx_k_96;
static PyObject *__pyx_k_107;
static PyObject *__pyx_k_127;
static PyObject *__pyx_k_135;
static PyObject *__pyx_k_144;
static PyObject *__pyx_k_148;
static PyObject *__pyx_k_149;
static PyObject *__pyx_k_150;
static PyObject *__pyx_k_151;
static PyObject *__pyx_k_153;
static PyObject *__pyx_k_tuple_12;
static PyObject *__pyx_k_tuple_14;
static PyObject *__pyx_k_tuple_17;
static PyObject *__pyx_k_tuple_19;
static PyObject *__pyx_k_tuple_21;
static PyObject *__pyx_k_tuple_24;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_28;
static PyObject *__pyx_k_tuple_30;
static PyObject *__pyx_k_tuple_32;
static PyObject *__pyx_k_tuple_33;
static PyObject *__pyx_k_tuple_35;
static PyObject *__pyx_k_tuple_37;
static PyObject *__pyx_k_tuple_38;
static PyObject *__pyx_k_tuple_40;
static PyObject *__pyx_k_tuple_42;
static PyObject *__pyx_k_tuple_44;
static PyObject *__pyx_k_tuple_46;
static PyObject *__pyx_k_tuple_47;
static PyObject *__pyx_k_tuple_54;
static PyObject *__pyx_k_tuple_56;
static PyObject *__pyx_k_tuple_59;
static PyObject *__pyx_k_tuple_61;
static PyObject *__pyx_k_tuple_63;
static PyObject *__pyx_k_tuple_72;
static PyObject *__pyx_k_tuple_76;
static PyObject *__pyx_k_tuple_78;
static PyObject *__pyx_k_tuple_80;
static PyObject *__pyx_k_tuple_82;
static PyObject *__pyx_k_tuple_83;
static PyObject *__pyx_k_tuple_85;
static PyObject *__pyx_k_tuple_95;
static PyObject *__pyx_k_tuple_99;
static PyObject *__pyx_k_tuple_100;
static PyObject *__pyx_k_tuple_109;
static PyObject *__pyx_k_tuple_111;
static PyObject *__pyx_k_tuple_113;
static PyObject *__pyx_k_tuple_115;
static PyObject *__pyx_k_tuple_117;
static PyObject *__pyx_k_tuple_119;
static PyObject *__pyx_k_tuple_121;
static PyObject *__pyx_k_tuple_123;
static PyObject *__pyx_k_tuple_125;
static PyObject *__pyx_k_tuple_129;
static PyObject *__pyx_k_tuple_132;
static PyObject *__pyx_k_tuple_134;
static PyObject *__pyx_k_tuple_137;
static PyObject *__pyx_k_tuple_139;
static PyObject *__pyx_k_tuple_141;
static PyObject *__pyx_k_tuple_143;
static PyObject *__pyx_k_tuple_146;
static PyObject *__pyx_k_tuple_147;
static PyObject *__pyx_k_tuple_154;
static PyObject *__pyx_k_tuple_155;
static PyObject *__pyx_k_tuple_156;
static PyObject *__pyx_k_tuple_157;
static PyObject *__pyx_k_tuple_158;
static PyObject *__pyx_k_tuple_160;
static PyObject *__pyx_k_tuple_162;
static PyObject *__pyx_k_tuple_164;
static PyObject *__pyx_k_tuple_167;
static PyObject *__pyx_k_tuple_168;
static PyObject *__pyx_k_tuple_170;
static PyObject *__pyx_k_tuple_187;
static PyObject *__pyx_k_codeobj_188;

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

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

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

/* "pyfmi\fmi.pyx":102
 * 
 * #CALLBACKS
 * cdef void importlogger_load_fmu(FMIL.jm_callbacks* c, FMIL.jm_string module, int log_level, FMIL.jm_string message):             # <<<<<<<<<<<<<<
 *     if log_level <= c.log_level:
 *         print "FMIL: module = %s, log level = %d: %s"%(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) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("importlogger_load_fmu", 0);

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

    /* "pyfmi\fmi.pyx":104
 * cdef void importlogger_load_fmu(FMIL.jm_callbacks* c, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 *     if log_level <= c.log_level:
 *         print "FMIL: module = %s, log level = %d: %s"%(module, log_level, message)             # <<<<<<<<<<<<<<
 *     #(<FMUModelBase>c.context)._logger(module,log_level,message)
 * 
 */
    __pyx_t_2 = PyBytes_FromString(__pyx_v_module); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyInt_FromLong(__pyx_v_log_level); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  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_WriteUnraisable("pyfmi.fmi.importlogger_load_fmu", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":107
 *     #(<FMUModelBase>c.context)._logger(module,log_level,message)
 * 
 * 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":110
 *     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":111
 *     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":112
 *     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":113
 *     FMIL.vsnprintf(buf, 1000, message, args)
 *     FMIL.va_end(args)
 *     print "FMU: fmiStatus = %d;  %s (%s): %s\n"%(status, instanceName, category, buf)             # <<<<<<<<<<<<<<
 * 
 * cdef class BaseModel:
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyBytes_FromString(__pyx_v_instanceName); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = PyBytes_FromString(__pyx_v_category); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = PyBytes_FromString(__pyx_v_buf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9BaseModel_1set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9BaseModel_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_9BaseModel_1set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variable_name = 0;
  PyObject *__pyx_v_value = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variable_name,&__pyx_n_s__value,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variable_name);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __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 = 120; __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.BaseModel.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9BaseModel_set(((struct __pyx_obj_5pyfmi_3fmi_BaseModel *)__pyx_v_self), __pyx_v_variable_name, __pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9BaseModel_3get(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9BaseModel_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_9BaseModel_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_9BaseModel_2get(((struct __pyx_obj_5pyfmi_3fmi_BaseModel *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9BaseModel_5_exec_algorithm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9BaseModel_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_9BaseModel_5_exec_algorithm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__module,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_exec_algorithm (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__module);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_algorithm", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_algorithm", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __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 = 173; __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 = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.BaseModel._exec_algorithm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9BaseModel_4_exec_algorithm(((struct __pyx_obj_5pyfmi_3fmi_BaseModel *)__pyx_v_self), __pyx_v_module, __pyx_v_algorithm, __pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

  /* "pyfmi\fmi.pyx":184
 *         """
 *         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 = 184; __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 = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (__pyx_v_module) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__module), __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algorithm) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__algorithm), __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_alg) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__alg), __pyx_v_alg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (((PyObject *)__pyx_v_self)) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_AlgorithmBase) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__AlgorithmBase), __pyx_v_AlgorithmBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_base_path) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__base_path), __pyx_v_base_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algdrive) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__algdrive), __pyx_v_algdrive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_options) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__options), __pyx_v_options) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __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 = 184; __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 = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_base_path);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_base_path);
  __Pyx_GIVEREF(__pyx_v_base_path);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_algdrive = __pyx_t_3;
  __pyx_t_3 = 0;

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

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

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

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

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

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

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

  /* "pyfmi\fmi.pyx":198
 *         alg = algorithm(self, options)
 *         # solve optimization problem/initialize
 *         alg.solve()             # <<<<<<<<<<<<<<
 *         # get and return result
 *         return alg.get_result()
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_alg, __pyx_n_s__solve); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":200
 *         alg.solve()
 *         # get and return result
 *         return alg.get_result()             # <<<<<<<<<<<<<<
 * 
 *     def _exec_simulate_algorithm(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_alg, __pyx_n_s__get_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9BaseModel_7_exec_simulate_algorithm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9BaseModel_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_9BaseModel_7_exec_simulate_algorithm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_final_time = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start_time,&__pyx_n_s__final_time,&__pyx_n_s__input,&__pyx_n_s__module,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_exec_simulate_algorithm (wrapper)", 0);
  {
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_time);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__final_time);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__module);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options);
        if (likely(values[5])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __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 = 202; __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 = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.BaseModel._exec_simulate_algorithm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9BaseModel_6_exec_simulate_algorithm(((struct __pyx_obj_5pyfmi_3fmi_BaseModel *)__pyx_v_self), __pyx_v_start_time, __pyx_v_final_time, __pyx_v_input, __pyx_v_module, __pyx_v_algorithm, __pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

  /* "pyfmi\fmi.pyx":219
 *         """
 *         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 = 219; __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 = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (__pyx_v_final_time) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__final_time), __pyx_v_final_time) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algorithm) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__algorithm), __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_alg) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__alg), __pyx_v_alg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (((PyObject *)__pyx_v_self)) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_AlgorithmBase) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__AlgorithmBase), __pyx_v_AlgorithmBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_module) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__module), __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_options) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__options), __pyx_v_options) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_base_path) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__base_path), __pyx_v_base_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_input) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__input), __pyx_v_input) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_start_time) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__start_time), __pyx_v_start_time) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algdrive) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__algdrive), __pyx_v_algdrive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __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 = 219; __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 = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_base_path);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_base_path);
  __Pyx_GIVEREF(__pyx_v_base_path);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_algdrive = __pyx_t_3;
  __pyx_t_3 = 0;

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

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

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

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

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

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

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

  /* "pyfmi\fmi.pyx":233
 *         alg = algorithm(start_time, final_time, input, self, options)
 *         # simulate
 *         alg.solve()             # <<<<<<<<<<<<<<
 *         # get and return result
 *         return alg.get_result()
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_alg, __pyx_n_s__solve); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":235
 *         alg.solve()
 *         # get and return result
 *         return alg.get_result()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_alg, __pyx_n_s__get_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

static PyObject *__pyx_pf_5pyfmi_3fmi_9BaseModel_8_default_options(struct __pyx_obj_5pyfmi_3fmi_BaseModel *__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":243
 *         'algorithm'.
 *         """
 *         module = __import__(module, globals(), locals(), [algorithm], -1)             # <<<<<<<<<<<<<<
 *         algorithm = getattr(module, algorithm)
 * 
 */
  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 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(((PyObject *)__pyx_t_2));
  if (((PyObject *)__pyx_v_self)) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algorithm) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__algorithm), __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_module) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__module), __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __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 = 243; __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 = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_module);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_module);
  __Pyx_GIVEREF(__pyx_v_module);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_v_module);
  __pyx_v_module = __pyx_t_3;
  __pyx_t_3 = 0;

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

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

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

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

/* "pyfmi\fmi.pyx":269
 *     cdef FMIL.fmi1_variable_alias_kind_enu_t _alias
 * 
 *     def __init__(self, name, value_reference, type, description="",             # <<<<<<<<<<<<<<
 *                        variability=FMIL.fmi1_variability_enu_continuous,
 *                        causality=FMIL.fmi1_causality_enu_internal,
 */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase___init__[] = "\n        Constructor.\n        ";
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__;
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,0};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_9);
    values[2] = __pyx_k_10;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __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 = 399; __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":399
 *     cdef int _fmu_kind
 * 
 *     def __init__(self, fmu, path='.', enable_logging=True):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor.
 */

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) {
  int __pyx_v_status;
  int __pyx_v_version;
  PyObject *__pyx_v_fmu_full_path = NULL;
  PyObject *__pyx_v_fmu_temp_dir = NULL;
  jm_string __pyx_v_last_error;
  PyObject *__pyx_v_fmu_kind = NULL;
  PyObject *__pyx_v_reals_continuous = NULL;
  PyObject *__pyx_v_reals_discrete = NULL;
  PyObject *__pyx_v_int_discrete = NULL;
  PyObject *__pyx_v_bool_discrete = NULL;
  PyObject *__pyx_v_var = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  jm_log_level_enu_t __pyx_t_7;
  char *__pyx_t_8;
  char *__pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":407
 * 
 *         #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 = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->_log);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_log));
  __pyx_v_self->_log = __pyx_t_1;
  __pyx_t_1 = 0;

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

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

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

  /* "pyfmi\fmi.pyx":413
 *         self._allocated_dll = False
 *         self._allocated_xml = False
 *         self._allocated_fmu = False             # <<<<<<<<<<<<<<
 *         self._allocated_list = False
 *         self._fmu_temp_dir = None
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); 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_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_allocated_fmu);
  __Pyx_DECREF(__pyx_v_self->_allocated_fmu);
  __pyx_v_self->_allocated_fmu = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":414
 *         self._allocated_xml = False
 *         self._allocated_fmu = False
 *         self._allocated_list = False             # <<<<<<<<<<<<<<
 *         self._fmu_temp_dir = None
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); 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_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_allocated_list);
  __Pyx_DECREF(__pyx_v_self->_allocated_list);
  __pyx_v_self->_allocated_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":415
 *         self._allocated_fmu = False
 *         self._allocated_list = False
 *         self._fmu_temp_dir = None             # <<<<<<<<<<<<<<
 * 
 *         fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_fmu_temp_dir);
  __Pyx_DECREF(__pyx_v_self->_fmu_temp_dir);
  __pyx_v_self->_fmu_temp_dir = Py_None;

  /* "pyfmi\fmi.pyx":417
 *         self._fmu_temp_dir = None
 * 
 *         fmu_full_path = os.path.abspath(os.path.join(path,fmu))             # <<<<<<<<<<<<<<
 *         fmu_temp_dir  = create_temp_dir()
 *         self._fmu_temp_dir = fmu_temp_dir
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__abspath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_fmu_full_path = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":418
 * 
 *         fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *         fmu_temp_dir  = create_temp_dir()             # <<<<<<<<<<<<<<
 *         self._fmu_temp_dir = fmu_temp_dir
 * 
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__create_temp_dir); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_fmu_temp_dir = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":419
 *         fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *         fmu_temp_dir  = create_temp_dir()
 *         self._fmu_temp_dir = fmu_temp_dir             # <<<<<<<<<<<<<<
 * 
 *         # Check that the file referenced by fmu has the correct file-ending
 */
  __Pyx_INCREF(__pyx_v_fmu_temp_dir);
  __Pyx_GIVEREF(__pyx_v_fmu_temp_dir);
  __Pyx_GOTREF(__pyx_v_self->_fmu_temp_dir);
  __Pyx_DECREF(__pyx_v_self->_fmu_temp_dir);
  __pyx_v_self->_fmu_temp_dir = __pyx_v_fmu_temp_dir;

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

    /* "pyfmi\fmi.pyx":423
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu_full_path.endswith(".fmu"):
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *         #Specify the general callback functions
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __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 = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":426
 * 
 *         #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":427
 *         #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":428
 *         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":429
 *         self.callbacks.calloc  = FMIL.calloc
 *         self.callbacks.realloc = FMIL.realloc
 *         self.callbacks.free    = FMIL.free             # <<<<<<<<<<<<<<
 *         self.callbacks.logger  = importlogger
 *         #self.callbacks.context = NULL;
 */
  __pyx_v_self->callbacks.free = free;

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

  /* "pyfmi\fmi.pyx":432
 *         self.callbacks.logger  = importlogger
 *         #self.callbacks.context = NULL;
 *         self.callbacks.context = <void*>self #Class loggger             # <<<<<<<<<<<<<<
 *         self.callbacks.log_level = FMIL.jm_log_level_warning if enable_logging else FMIL.jm_log_level_nothing
 * 
 */
  __pyx_v_self->callbacks.context = ((void *)__pyx_v_self);

  /* "pyfmi\fmi.pyx":433
 *         #self.callbacks.context = NULL;
 *         self.callbacks.context = <void*>self #Class loggger
 *         self.callbacks.log_level = FMIL.jm_log_level_warning if enable_logging else FMIL.jm_log_level_nothing             # <<<<<<<<<<<<<<
 * 
 *         #Specify FMI related callbacks
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {
    __pyx_t_7 = jm_log_level_warning;
  } else {
    __pyx_t_7 = jm_log_level_nothing;
  }
  __pyx_v_self->callbacks.log_level = __pyx_t_7;

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

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

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

  /* "pyfmi\fmi.pyx":440
 *         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":442
 *         self.callBackFunctions.stepFinished = NULL;
 * 
 *         self.context = FMIL.fmi_import_allocate_context(&self.callbacks)             # <<<<<<<<<<<<<<
 *         self._allocated_context = True
 * 
 */
  __pyx_v_self->context = fmi_import_allocate_context((&__pyx_v_self->callbacks));

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

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

  /* "pyfmi\fmi.pyx":447
 *         #Get the FMI version of the provided model
 *         version = FMIL.fmi_import_get_fmi_version(self.context, fmu_full_path, fmu_temp_dir)
 *         self._version = version #Store version             # <<<<<<<<<<<<<<
 * 
 *         if version == FMIL.fmi_version_unknown_enu:
 */
  __pyx_v_self->_version = __pyx_v_version;

  /* "pyfmi\fmi.pyx":449
 *         self._version = version #Store version
 * 
 *         if version == FMIL.fmi_version_unknown_enu:             # <<<<<<<<<<<<<<
 *             last_error = FMIL.jm_get_last_error(&self.callbacks)
 *             if enable_logging:
 */
  __pyx_t_6 = (__pyx_v_version == fmi_version_unknown_enu);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":450
 * 
 *         if 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":451
 *         if 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_6 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":452
 *             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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_15), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_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 = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":454
 *                 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("PyFMI currently only supports FMI 1.0.")
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); 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_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __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 = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":455
 *             else:
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 *         if version != 1:             # <<<<<<<<<<<<<<
 *             raise FMUException("PyFMI currently only supports FMI 1.0.")
 * 
 */
  __pyx_t_6 = (__pyx_v_version != 1);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":456
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 *         if version != 1:
 *             raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *         #Parse the XML
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __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 = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

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

  /* "pyfmi\fmi.pyx":460
 *         #Parse the XML
 *         self._fmu = FMIL.fmi1_import_parse_xml(self.context, fmu_temp_dir)
 *         self._allocated_xml = True             # <<<<<<<<<<<<<<
 * 
 *         #Check the FMU kind
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_allocated_xml);
  __Pyx_DECREF(__pyx_v_self->_allocated_xml);
  __pyx_v_self->_allocated_xml = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":463
 * 
 *         #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("PyFMI currently only supports FMI 1.0 for Model Exchange.")
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_fmu_kind(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fmu_kind = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":464
 *         #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("PyFMI currently only supports FMI 1.0 for Model Exchange.")
 *         self._fmu_kind = fmu_kind
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_ME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_fmu_kind, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_CS_STANDALONE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_fmu_kind, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_t_5;
  } else {
    __pyx_t_10 = __pyx_t_6;
  }
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":465
 *         fmu_kind = FMIL.fmi1_import_get_fmu_kind(self._fmu)
 *         if fmu_kind != FMI_ME and fmu_kind != FMI_CS_STANDALONE:
 *             raise FMUException("PyFMI currently only supports FMI 1.0 for Model Exchange.")             # <<<<<<<<<<<<<<
 *         self._fmu_kind = fmu_kind
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __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 = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

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

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

  /* "pyfmi\fmi.pyx":472
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);
 *         #status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, 0);
 *         if status == FMIL.jm_status_error:             # <<<<<<<<<<<<<<
 *             last_error = FMIL.fmi1_import_get_last_error(self._fmu)
 *             if enable_logging:
 */
  __pyx_t_10 = (__pyx_v_status == jm_status_error);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":473
 *         #status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, 0);
 *         if status == FMIL.jm_status_error:
 *             last_error = FMIL.fmi1_import_get_last_error(self._fmu)             # <<<<<<<<<<<<<<
 *             if enable_logging:
 *                 raise FMUException(last_error)
 */
    __pyx_v_last_error = fmi1_import_get_last_error(__pyx_v_self->_fmu);

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

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

      /* "pyfmi\fmi.pyx":477
 *                 raise FMUException(last_error)
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *             #raise FMUException("The DLL could not be loaded, reported error: "+ last_error)
 *         self._allocated_dll = True
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __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 = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L9:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":479
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")
 *             #raise FMUException("The DLL could not be loaded, reported error: "+ last_error)
 *         self._allocated_dll = True             # <<<<<<<<<<<<<<
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs
 * 
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->_allocated_dll);
  __Pyx_DECREF(__pyx_v_self->_allocated_dll);
  __pyx_v_self->_allocated_dll = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":480
 *             #raise FMUException("The DLL could not be loaded, reported error: "+ last_error)
 *         self._allocated_dll = True
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_22); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_22, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":487
 *         #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":488
 *         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":489
 *         self._npoints = 0
 *         self._enable_logging = enable_logging
 *         self._pyEventInfo = PyEventInfo()             # <<<<<<<<<<<<<<
 * 
 *         #Load information from model
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PyEventInfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __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":492
 * 
 *         #Load information from model
 *         self._modelid = FMIL.fmi1_import_get_model_identifier(self._fmu)             # <<<<<<<<<<<<<<
 *         self._modelname = FMIL.fmi1_import_get_model_name(self._fmu)
 *         self._nEventIndicators = FMIL.fmi1_import_get_number_of_event_indicators(self._fmu)
 */
  __pyx_t_3 = PyBytes_FromString(fmi1_import_get_model_identifier(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_GOTREF(__pyx_v_self->_modelid);
  __Pyx_DECREF(__pyx_v_self->_modelid);
  __pyx_v_self->_modelid = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;

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

  /* "pyfmi\fmi.pyx":494
 *         self._modelid = FMIL.fmi1_import_get_model_identifier(self._fmu)
 *         self._modelname = FMIL.fmi1_import_get_model_name(self._fmu)
 *         self._nEventIndicators = FMIL.fmi1_import_get_number_of_event_indicators(self._fmu)             # <<<<<<<<<<<<<<
 *         self._nContinuousStates = FMIL.fmi1_import_get_number_of_continuous_states(self._fmu)
 * 
 */
  __pyx_v_self->_nEventIndicators = fmi1_import_get_number_of_event_indicators(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":495
 *         self._modelname = FMIL.fmi1_import_get_model_name(self._fmu)
 *         self._nEventIndicators = FMIL.fmi1_import_get_number_of_event_indicators(self._fmu)
 *         self._nContinuousStates = FMIL.fmi1_import_get_number_of_continuous_states(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         #Instantiates the model
 */
  __pyx_v_self->_nContinuousStates = fmi1_import_get_number_of_continuous_states(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":506
 * 
 *         #Store the continuous and discrete variables for result writing
 *         reals_continuous = self.get_model_variables(type=0, include_alias=False, variability=3)             # <<<<<<<<<<<<<<
 *         reals_discrete = self.get_model_variables(type=0, include_alias=False, variability=2)
 *         int_discrete = self.get_model_variables(type=1, include_alias=False, variability=2)
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_model_variables); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __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 = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__type), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__include_alias), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__variability), __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_reals_continuous = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":507
 *         #Store the continuous and discrete variables for result writing
 *         reals_continuous = self.get_model_variables(type=0, include_alias=False, variability=3)
 *         reals_discrete = self.get_model_variables(type=0, include_alias=False, variability=2)             # <<<<<<<<<<<<<<
 *         int_discrete = self.get_model_variables(type=1, include_alias=False, variability=2)
 *         bool_discrete = self.get_model_variables(type=2, include_alias=False, variability=2)
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_model_variables); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__type), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__include_alias), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__variability), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_reals_discrete = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":508
 *         reals_continuous = self.get_model_variables(type=0, include_alias=False, variability=3)
 *         reals_discrete = self.get_model_variables(type=0, include_alias=False, variability=2)
 *         int_discrete = self.get_model_variables(type=1, include_alias=False, variability=2)             # <<<<<<<<<<<<<<
 *         bool_discrete = self.get_model_variables(type=2, include_alias=False, variability=2)
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_model_variables); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __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 = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__type), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__include_alias), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__variability), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_int_discrete = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":509
 *         reals_discrete = self.get_model_variables(type=0, include_alias=False, variability=2)
 *         int_discrete = self.get_model_variables(type=1, include_alias=False, variability=2)
 *         bool_discrete = self.get_model_variables(type=2, include_alias=False, variability=2)             # <<<<<<<<<<<<<<
 * 
 *         self._save_real_variables_val = [var.value_reference for var in reals_continuous.values()]+[var.value_reference for var in reals_discrete.values()]
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_model_variables); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__type), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__include_alias), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__variability), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_bool_discrete = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":511
 *         bool_discrete = self.get_model_variables(type=2, include_alias=False, variability=2)
 * 
 *         self._save_real_variables_val = [var.value_reference for var in reals_continuous.values()]+[var.value_reference for var in reals_discrete.values()]             # <<<<<<<<<<<<<<
 *         self._save_int_variables_val  = [var.value_reference for var in int_discrete.values()]
 *         self._save_bool_variables_val = [var.value_reference for var in bool_discrete.values()]
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_reals_continuous, __pyx_n_s__values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++;
    } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++;
    } else {
      __pyx_t_4 = __pyx_t_13(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_var);
    __pyx_v_var = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_var, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_reals_discrete, __pyx_n_s__values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_13 = Py_TYPE(__pyx_t_4)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_4)) {
      if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
    } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_4)) {
      if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
    } else {
      __pyx_t_2 = __pyx_t_13(__pyx_t_4);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_v_var);
    __pyx_v_var = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_var, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __Pyx_GOTREF(__pyx_v_self->_save_real_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
  __pyx_v_self->_save_real_variables_val = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":512
 * 
 *         self._save_real_variables_val = [var.value_reference for var in reals_continuous.values()]+[var.value_reference for var in reals_discrete.values()]
 *         self._save_int_variables_val  = [var.value_reference for var in int_discrete.values()]             # <<<<<<<<<<<<<<
 *         self._save_bool_variables_val = [var.value_reference for var in bool_discrete.values()]
 * 
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_int_discrete, __pyx_n_s__values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++;
    } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++;
    } else {
      __pyx_t_3 = __pyx_t_13(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_v_var);
    __pyx_v_var = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_var, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __Pyx_GOTREF(__pyx_v_self->_save_int_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
  __pyx_v_self->_save_int_variables_val = __pyx_t_4;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":513
 *         self._save_real_variables_val = [var.value_reference for var in reals_continuous.values()]+[var.value_reference for var in reals_discrete.values()]
 *         self._save_int_variables_val  = [var.value_reference for var in int_discrete.values()]
 *         self._save_bool_variables_val = [var.value_reference for var in bool_discrete.values()]             # <<<<<<<<<<<<<<
 * 
 *         """
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_bool_discrete, __pyx_n_s__values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++;
    } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++;
    } else {
      __pyx_t_3 = __pyx_t_13(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_v_var);
    __pyx_v_var = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_var, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __Pyx_GOTREF(__pyx_v_self->_save_bool_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
  __pyx_v_self->_save_bool_variables_val = __pyx_t_4;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmu_full_path);
  __Pyx_XDECREF(__pyx_v_fmu_temp_dir);
  __Pyx_XDECREF(__pyx_v_fmu_kind);
  __Pyx_XDECREF(__pyx_v_reals_continuous);
  __Pyx_XDECREF(__pyx_v_reals_discrete);
  __Pyx_XDECREF(__pyx_v_int_discrete);
  __Pyx_XDECREF(__pyx_v_bool_discrete);
  __Pyx_XDECREF(__pyx_v_var);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":530
 *             pass
 *         """
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message):             # <<<<<<<<<<<<<<
 *         #print "FMIL: module = %s, log level = %d: %s"%(module, log_level, message)
 *         self._log.append([module,log_level,message])
 */

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_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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_logger", 0);

  /* "pyfmi\fmi.pyx":532
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 *         #print "FMIL: module = %s, log level = %d: %s"%(module, log_level, message)
 *         self._log.append([module,log_level,message])             # <<<<<<<<<<<<<<
 * 
 *     def get_log(self):
 */
  if (unlikely(((PyObject *)__pyx_v_self->_log) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyBytes_FromString(__pyx_v_module); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyInt_FromLong(__pyx_v_log_level); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_5 = PyList_Append(__pyx_v_self->_log, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._logger", __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_3get_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_2get_log[] = "\n        Returns the log information as a list. To turn on the logging use the \n        method, set_debug_logging(True) in the instantiation, \n        FMUModel(..., enable_logging=True). The log is stored as a list of lists. \n        For example log[0] are the first log message to the log and consists of, \n        in the following order, the instance name, the status, the category and \n        the message.\n        \n        Returns::\n        \n            log - A list of lists.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3get_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_log (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_2get_log(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* "pyfmi\fmi.pyx":547
 *             log - A list of lists.
 *         """
 *         return self._log             # <<<<<<<<<<<<<<
 * 
 *     def print_log(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_log));
  __pyx_r = ((PyObject *)__pyx_v_self->_log);
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_5print_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_4print_log[] = "\n        Prints the log information to the prompt.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_5print_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_4print_log(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_4print_log(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_v_N;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __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("print_log", 0);

  /* "pyfmi\fmi.pyx":553
 *         Prints the log information to the prompt.
 *         """
 *         cdef int N = len(self._log)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(N):
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->_log);
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_2;

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

    /* "pyfmi\fmi.pyx":556
 * 
 *         for i in range(N):
 *             print "FMIL: module = %s, log level = %d: %s"%(self._log[i][0], self._log[i][1], self._log[i][2])             # <<<<<<<<<<<<<<
 * 
 *     #def __dealloc__(self):
 */
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_self->_log), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_self->_log), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __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_GetItemInt_List(((PyObject *)__pyx_v_self->_log), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __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 = 556; __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);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_7)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  }

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_7_get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_6_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_7_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_6_get_version(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_6_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":591
 *             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":592
 *         """
 *         version = FMIL.fmi1_import_get_version(self._fmu)
 *         return version             # <<<<<<<<<<<<<<
 * 
 *     version = property(fget=_get_version)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_9get_ode_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_8get_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_9get_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_8get_ode_sizes(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8get_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":613
 *             [nCont, nEvent] = model.get_ode_sizes()
 *         """
 *         return self._nContinuousStates, self._nEventIndicators             # <<<<<<<<<<<<<<
 * 
 *     def get_real(self, valueref):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->_nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_self->_nEventIndicators); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __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 = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_11get_real(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_10get_real[] = "\n        Returns the real-values from the valuereference(s).\n        \n        Parameters::\n        \n            valueref -- \n                A list of valuereferences.\n                \n        Returns::\n        \n            values -- \n                The values retrieved from the FMU.\n                \n        Example::\n        \n            val = model.get_real([232])\n                \n        Calls the low-level FMI function: fmiGetReal/fmiSetReal\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_11get_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_10get_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /* "pyfmi\fmi.pyx":674
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_28), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_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 = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15get_integer(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_14get_integer[] = "\n        Returns the integer-values from the valuereference(s).\n        \n        Parameters::\n        \n            valueref -- \n                A list of valuereferences.\n                \n        Return::\n            \n            values -- \n                The values retrieved from the FMU.\n                \n        Example::\n        \n            val = model.get_integer([232])\n                \n        Calls the low-level FMI function: fmiGetInteger/fmiSetInteger\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15get_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_14get_integer(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_19get_boolean(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_18get_boolean[] = "\n        Returns the boolean-values from the valuereference(s).\n        \n        Parameters::\n        \n            valueref -- \n                A list of valuereferences.\n                \n        Returns::\n        \n            values -- \n                The values retrieved from the FMU.\n                \n        Example::\n        \n            val = model.get_boolean([232])\n                \n        Calls the low-level FMI function: fmiGetBoolean/fmiSetBoolean\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_19get_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_18get_boolean(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

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

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

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

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

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

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

    /* "pyfmi\fmi.pyx":794
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         return N.array(return_values)
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __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 = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

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

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

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

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

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

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

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

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

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

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

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

    /* "pyfmi\fmi.pyx":836
 * 
 *         if val_ref.size != values.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_38), NULL); 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_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 = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23get_string(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_22get_string[] = "\n        Returns the string-values from the valuereference(s).\n        \n        Parameters::\n        \n            valueref -- \n                A list of valuereferences.\n                \n        Returns::\n        \n            values -- \n                The values retrieved from the FMU.\n                \n        Example::\n        \n            val = model.get_string([232])\n                \n        Calls the low-level FMI function: fmiGetString/fmiSetString\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23get_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_22get_string(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_22get_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":867
 *         Calls the low-level FMI function: fmiGetString/fmiSetString
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef FMIL.size_t nref
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

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

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24set_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":902
 *         Calls the low-level FMI function: fmiGetString/fmiSetString
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef FMIL.size_t nref
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_27set_debug_logging(PyObject *__pyx_v_self, PyObject *__pyx_v_flag); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_26set_debug_logging[] = "\n        Specifies if the debugging should be turned on or off.\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_27set_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_26set_debug_logging(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_flag));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_26set_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
  jm_log_level_enu_t __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_debug_logging", 0);

  /* "pyfmi\fmi.pyx":938
 *         cdef int status
 * 
 *         self.callbacks.log_level = FMIL.jm_log_level_warning if flag else FMIL.jm_log_level_nothing             # <<<<<<<<<<<<<<
 * 
 *         if flag:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __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":940
 *         self.callbacks.log_level = FMIL.jm_log_level_warning if flag else FMIL.jm_log_level_nothing
 * 
 *         if flag:             # <<<<<<<<<<<<<<
 *             log = 1
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

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

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

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

    /* "pyfmi\fmi.pyx":949
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_42), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __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 = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_29set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_28set_fmil_log_level[] = "\n        Specifices the log level for FMI Library. Note that this is\n        different from the FMU logging which is specificed via\n        set_debug_logging.\n        \n        Parameters::\n\t\t\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_29set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level) {
  jm_log_level_enu_t __pyx_v_level;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_fmil_log_level (wrapper)", 0);
  assert(__pyx_arg_level); {
    __pyx_v_level = ((jm_log_level_enu_t)PyInt_AsLong(__pyx_arg_level)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __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_28set_fmil_log_level(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((jm_log_level_enu_t)__pyx_v_level));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":967
 *     #    self._log = []
 * 
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):             # <<<<<<<<<<<<<<
 *         """
 *         Specifices the log level for FMI Library. Note that this is
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_28set_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
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_fmil_log_level", 0);

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

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

  /* "pyfmi\fmi.pyx":988
 *         if level < 0 or level > 7:
 *             raise FMUException("Invalid log level for FMI Library (0-7).")
 *         self.callbacks.log_level = level             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->callbacks.log_level = __pyx_v_level;

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

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

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

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

  /* "pyfmi\fmi.pyx":998
 *         cdef FMIL.fmi1_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_FMUModelBase *)__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 = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ref = __pyx_t_1;

  /* "pyfmi\fmi.pyx":999
 * 
 *         ref = self.get_variable_valueref(variable_name)
 *         type = self.get_variable_data_type(variable_name)             # <<<<<<<<<<<<<<
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__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 = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_type = __pyx_t_2;

  /* "pyfmi\fmi.pyx":1001
 *         type = self.get_variable_data_type(variable_name)
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL             # <<<<<<<<<<<<<<
 *             self.set_real([ref], [value])
 *         elif type == FMIL.fmi1_base_type_int: #INTEGER
 */
  __pyx_t_3 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_3) {

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

  /* "pyfmi\fmi.pyx":1003
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 *             self.set_real([ref], [value])
 *         elif type == FMIL.fmi1_base_type_int: #INTEGER             # <<<<<<<<<<<<<<
 *             self.set_integer([ref], [value])
 *         elif type == FMIL.fmi1_base_type_str: #STRING
 */
  __pyx_t_3 = (__pyx_v_type == fmi1_base_type_int);
  if (__pyx_t_3) {

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

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

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

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

    /* "pyfmi\fmi.pyx":1008
 *             self.set_string([ref], [value])
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN
 *             self.set_boolean([ref], [value])             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Type not supported.')
 */
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_boolean); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_7 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

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

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

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

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_32_get(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variable_name) {
  fmi1_value_reference_t __pyx_v_ref;
  enum fmi1_base_type_enu_t __pyx_v_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi1_value_reference_t __pyx_t_1;
  enum fmi1_base_type_enu_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get", 0);

  /* "pyfmi\fmi.pyx":1020
 *         cdef FMIL.fmi1_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_FMUModelBase *)__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 = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ref = __pyx_t_1;

  /* "pyfmi\fmi.pyx":1021
 * 
 *         ref = self.get_variable_valueref(variable_name)
 *         type = self.get_variable_data_type(variable_name)             # <<<<<<<<<<<<<<
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__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 = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_type = __pyx_t_2;

  /* "pyfmi\fmi.pyx":1023
 *         type = self.get_variable_data_type(variable_name)
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL             # <<<<<<<<<<<<<<
 *             return self.get_real([ref])
 *         elif type == FMIL.fmi1_base_type_int: #INTEGER
 */
  __pyx_t_3 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1024
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 *             return self.get_real([ref])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi1_base_type_int: #INTEGER
 *             return self.get_integer([ref])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_real); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __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 = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":1025
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 *             return self.get_real([ref])
 *         elif type == FMIL.fmi1_base_type_int: #INTEGER             # <<<<<<<<<<<<<<
 *             return self.get_integer([ref])
 *         elif type == FMIL.fmi1_base_type_str: #STRING
 */
  __pyx_t_3 = (__pyx_v_type == fmi1_base_type_int);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1026
 *             return self.get_real([ref])
 *         elif type == FMIL.fmi1_base_type_int: #INTEGER
 *             return self.get_integer([ref])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi1_base_type_str: #STRING
 *             return self.get_string([ref])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_integer); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":1027
 *         elif type == FMIL.fmi1_base_type_int: #INTEGER
 *             return self.get_integer([ref])
 *         elif type == FMIL.fmi1_base_type_str: #STRING             # <<<<<<<<<<<<<<
 *             return self.get_string([ref])
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN
 */
  __pyx_t_3 = (__pyx_v_type == fmi1_base_type_str);
  if (__pyx_t_3) {

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

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

    /* "pyfmi\fmi.pyx":1030
 *             return self.get_string([ref])
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN
 *             return self.get_boolean([ref])             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Type not supported.')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_boolean); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1032
 *             return self.get_boolean([ref])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_description(self, char* variablename):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

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

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

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_34get_variable_description[] = "\n        Get the description of a given variable.\n        \n        Parameter::\n        \n            variablename --\n                The name of the variable\n                \n        Returns::\n        \n            The description of the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_description (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = PyBytes_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_34get_variable_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_34get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_description", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_vtab)->get_variable_description(__pyx_v_self, __pyx_v_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_36get_variable_data_type[] = " \n        Get data type of variable. \n        \n        Parameter::\n        \n            variablename --\n                The name of the variable.\n                \n        Returns::\n        \n            The type of the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_data_type (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = PyBytes_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_data_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_36get_variable_data_type(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

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

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static fmi1_value_reference_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_value_reference_t __pyx_v_vr;
  fmi1_value_reference_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  fmi1_value_reference_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_valueref", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_51); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __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_39get_variable_valueref)) {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyInt_from_py_fmi1_value_reference_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (fmi1_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

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

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

  /* "pyfmi\fmi.pyx":1101
 *         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":1103
 *         vr =  FMIL.fmi1_import_get_variable_vr(variable)
 * 
 *         return vr             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_nominal(self, variablename=None, valueref=None):
 */
  __pyx_r = __pyx_v_vr;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_38get_variable_valueref[] = "\n        Extract the ValueReference given a variable name.\n        \n        Parameters::\n        \n            variablename -- \n                The name of the variable.\n            \n        Returns::\n        \n            The ValueReference for the variable passed as argument.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_valueref (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = PyBytes_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_38get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_40get_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_41get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variablename = 0;
  PyObject *__pyx_v_valueref = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variablename,&__pyx_n_s__valueref,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_nominal (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};

    /* "pyfmi\fmi.pyx":1105
 *         return vr
 * 
 *     def get_variable_nominal(self, variablename=None, valueref=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the nominal value from a real variable determined by
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variablename);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_variable_nominal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __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 = 1105; __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_40get_variable_nominal(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_variablename, __pyx_v_valueref);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "pyfmi\fmi.pyx":1124
 *         cdef FMIL.fmi1_import_real_variable_t *real_variable
 * 
 *         if valueref != None:             # <<<<<<<<<<<<<<
 *             variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, FMIL.fmi1_base_type_real, <FMIL.fmi1_value_reference_t>valueref)
 *             if variable == NULL:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_valueref, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __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 = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":1125
 * 
 *         if valueref != None:
 *             variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, FMIL.fmi1_base_type_real, <FMIL.fmi1_value_reference_t>valueref)             # <<<<<<<<<<<<<<
 *             if variable == NULL:
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 */
    __pyx_t_3 = __Pyx_PyInt_from_py_fmi1_value_reference_t(__pyx_v_valueref); if (unlikely((__pyx_t_3 == (fmi1_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __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":1126
 *         if valueref != None:
 *             variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, FMIL.fmi1_base_type_real, <FMIL.fmi1_value_reference_t>valueref)
 *             if variable == NULL:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 *         elif variablename != None:
 */
    __pyx_t_2 = (__pyx_v_variable == NULL);
    if (__pyx_t_2) {

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

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

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

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

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

    /* "pyfmi\fmi.pyx":1133
 *                 raise FMUException("The variable %s could not be found."%variablename)
 *         else:
 *             raise FMUException('Either provide value reference or variable name.')             # <<<<<<<<<<<<<<
 * 
 *         real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_54), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __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 = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1135
 *             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":1136
 * 
 *         real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *         if real_variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable is not a real variable.")
 * 
 */
  __pyx_t_2 = (__pyx_v_real_variable == NULL);
  if (__pyx_t_2) {

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

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

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

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

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_fixed(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  int __pyx_v_status;
  int __pyx_v_fixed;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_fixed", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_variable_fixed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __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_fixed)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

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

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

  /* "pyfmi\fmi.pyx":1162
 *             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":1164
 *         status = FMIL.fmi1_import_get_variable_has_start(variable)
 * 
 *         if status == 0:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s does not have a start value."%variablename)
 * 
 */
  __pyx_t_4 = (__pyx_v_status == 0);
  if (__pyx_t_4) {

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_fixed(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_42get_variable_fixed[] = "\n        Returns if the start value is fixed (True - The value is used as\n        an initial value) or not (False - The value is used as a guess\n        value).\n        \n        Parameters::\n        \n            variablename --\n                The name of the variable\n                \n        Returns::\n        \n            If the start value is fixed or not.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_fixed(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_fixed (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = PyBytes_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_fixed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_42get_variable_fixed(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_42get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_fixed", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_vtab)->get_variable_fixed(__pyx_v_self, __pyx_v_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

  /* "pyfmi\fmi.pyx":1194
 *         cdef FMIL.fmi1_base_type_enu_t type
 *         cdef int status
 *         cdef FMIL.fmi1_boolean_t FMITRUE = 1             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_v_FMITRUE = 1;

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

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

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

  /* "pyfmi\fmi.pyx":1200
 *             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":1202
 *         status = FMIL.fmi1_import_get_variable_has_start(variable)
 * 
 *         if status == 0:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s does not have a start value."%variablename)
 * 
 */
  __pyx_t_4 = (__pyx_v_status == 0);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":1205
 *             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":1207
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 *         if type == FMIL.fmi1_base_type_real:             # <<<<<<<<<<<<<<
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *             return FMIL.fmi1_import_get_real_variable_start(real_variable)
 */
  __pyx_t_4 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_4) {

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

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

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

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

    /* "pyfmi\fmi.pyx":1216
 * 
 *         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":1217
 *         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 = 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;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":1219
 *             return FMIL.fmi1_import_get_boolean_variable_start(bool_variable) == FMITRUE
 * 
 *         elif type == FMIL.fmi1_base_type_enum:             # <<<<<<<<<<<<<<
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)
 *             return FMIL.fmi1_import_get_enum_variable_start(enum_variable)
 */
  __pyx_t_4 = (__pyx_v_type == fmi1_base_type_enum);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1220
 * 
 *         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":1221
 *         elif type == FMIL.fmi1_base_type_enum:
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)
 *             return FMIL.fmi1_import_get_enum_variable_start(enum_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_str:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(fmi1_import_get_enum_variable_start(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":1223
 *             return FMIL.fmi1_import_get_enum_variable_start(enum_variable)
 * 
 *         elif type == FMIL.fmi1_base_type_str:             # <<<<<<<<<<<<<<
 *             str_variable = FMIL.fmi1_import_get_variable_as_string(variable)
 *             return FMIL.fmi1_import_get_string_variable_start(str_variable)
 */
  __pyx_t_4 = (__pyx_v_type == fmi1_base_type_str);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1224
 * 
 *         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":1225
 *         elif type == FMIL.fmi1_base_type_str:
 *             str_variable = FMIL.fmi1_import_get_variable_as_string(variable)
 *             return FMIL.fmi1_import_get_string_variable_start(str_variable)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyBytes_FromString(fmi1_import_get_string_variable_start(__pyx_v_str_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_r = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_44get_variable_start[] = "\n        Returns the start value for the variable or else raises\n        FMUException.\n        \n        Parameters::\n            \n            variablename --\n                The name of the variable\n                \n        Returns::\n        \n            The start value.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_start (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = PyBytes_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_44get_variable_start(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_44get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_vtab)->get_variable_start(__pyx_v_self, __pyx_v_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_integer_variable_t *__pyx_v_int_variable;
  fmi1_import_real_variable_t *__pyx_v_real_variable;
  fmi1_import_enum_variable_t *__pyx_v_enum_variable;
  enum fmi1_base_type_enu_t __pyx_v_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_max", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_variable_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __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_max)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

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

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

  /* "pyfmi\fmi.pyx":1253
 *             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":1255
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 *         if type == FMIL.fmi1_base_type_real:             # <<<<<<<<<<<<<<
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *             return FMIL.fmi1_import_get_real_variable_max(real_variable)
 */
  __pyx_t_4 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":1259
 *             return FMIL.fmi1_import_get_real_variable_max(real_variable)
 * 
 *         elif type == FMIL.fmi1_base_type_int:             # <<<<<<<<<<<<<<
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)
 *             return FMIL.fmi1_import_get_integer_variable_max(int_variable)
 */
  __pyx_t_4 = (__pyx_v_type == fmi1_base_type_int);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":1263
 *             return FMIL.fmi1_import_get_integer_variable_max(int_variable)
 * 
 *         elif type == FMIL.fmi1_base_type_enum:             # <<<<<<<<<<<<<<
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)
 *             return FMIL.fmi1_import_get_enum_variable_max(enum_variable)
 */
  __pyx_t_4 = (__pyx_v_type == fmi1_base_type_enum);
  if (__pyx_t_4) {

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_46get_variable_max[] = "\n        Returns the maximum value for the given variable.\n        \n        Parameters::\n        \n            variablename --\n                The name of the variable.\n                \n        Returns::\n        \n            The maximum value for the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_max (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = PyBytes_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_46get_variable_max(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_46get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_max", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_vtab)->get_variable_max(__pyx_v_self, __pyx_v_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_integer_variable_t *__pyx_v_int_variable;
  fmi1_import_real_variable_t *__pyx_v_real_variable;
  fmi1_import_enum_variable_t *__pyx_v_enum_variable;
  enum fmi1_base_type_enu_t __pyx_v_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_min", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_variable_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_variable_min)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

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

    /* "pyfmi\fmi.pyx":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)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1293
 *             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":1295
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 *         if type == FMIL.fmi1_base_type_real:             # <<<<<<<<<<<<<<
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *             return FMIL.fmi1_import_get_real_variable_min(real_variable)
 */
  __pyx_t_4 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":1299
 *             return FMIL.fmi1_import_get_real_variable_min(real_variable)
 * 
 *         elif type == FMIL.fmi1_base_type_int:             # <<<<<<<<<<<<<<
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)
 *             return FMIL.fmi1_import_get_integer_variable_min(int_variable)
 */
  __pyx_t_4 = (__pyx_v_type == fmi1_base_type_int);
  if (__pyx_t_4) {

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

  /* "pyfmi\fmi.pyx":1303
 *             return FMIL.fmi1_import_get_integer_variable_min(int_variable)
 * 
 *         elif type == FMIL.fmi1_base_type_enum:             # <<<<<<<<<<<<<<
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)
 *             return FMIL.fmi1_import_get_enum_variable_min(enum_variable)
 */
  __pyx_t_4 = (__pyx_v_type == fmi1_base_type_enum);
  if (__pyx_t_4) {

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_48get_variable_min[] = "\n        Returns the minimum value for the given variable.\n        \n        Parameters::\n        \n            variablename --\n                The name of the variable.\n                \n        Returns::\n        \n            The minimum value for the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_min (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = PyBytes_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_variable_min(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_min", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_vtab)->get_variable_min(__pyx_v_self, __pyx_v_variablename, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51save_time_point(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_50save_time_point[] = "\n        Retrieves the data at the current time-point of the variables defined\n        to be continuous and the variables defined to be discrete. The \n        information about the variables are retrieved from the XML-file.\n                \n        Returns::\n        \n            sol_real -- \n                The Real-valued variables.\n                \n            sol_int -- \n                The Integer-valued variables.\n                \n            sol_bool -- \n                The Boolean-valued variables.\n                \n        Example::\n        \n            [r,i,b] = model.save_time_point()\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51save_time_point(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_time_point (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_50save_time_point(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1311
 * 
 * 
 *     def save_time_point(self):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the data at the current time-point of the variables defined
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_50save_time_point(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_v_sol_real = NULL;
  PyObject *__pyx_v_sol_int = NULL;
  PyObject *__pyx_v_sol_bool = 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_time_point", 0);

  /* "pyfmi\fmi.pyx":1332
 *             [r,i,b] = model.save_time_point()
 *         """
 *         sol_real=N.array([])             # <<<<<<<<<<<<<<
 *         sol_int=N.array([])
 *         sol_bool=N.array([])
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __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(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __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 = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_sol_real = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1333
 *         """
 *         sol_real=N.array([])
 *         sol_int=N.array([])             # <<<<<<<<<<<<<<
 *         sol_bool=N.array([])
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); 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_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_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 = 1333; __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 = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_sol_int = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1334
 *         sol_real=N.array([])
 *         sol_int=N.array([])
 *         sol_bool=N.array([])             # <<<<<<<<<<<<<<
 * 
 *         if self._save_real_variables_val:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __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(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __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 = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_sol_bool = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1336
 *         sol_bool=N.array([])
 * 
 *         if self._save_real_variables_val:             # <<<<<<<<<<<<<<
 *             sol_real = self.get_real(self._save_real_variables_val)
 *         if self._save_int_variables_val:
 */
  __pyx_t_4 = (((PyObject *)__pyx_v_self->_save_real_variables_val) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_self->_save_real_variables_val)) != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1337
 * 
 *         if self._save_real_variables_val:
 *             sol_real = self.get_real(self._save_real_variables_val)             # <<<<<<<<<<<<<<
 *         if self._save_int_variables_val:
 *             sol_int  = self.get_integer(self._save_int_variables_val)
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_real); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __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 = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->_save_real_variables_val));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_sol_real);
    __pyx_v_sol_real = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1338
 *         if self._save_real_variables_val:
 *             sol_real = self.get_real(self._save_real_variables_val)
 *         if self._save_int_variables_val:             # <<<<<<<<<<<<<<
 *             sol_int  = self.get_integer(self._save_int_variables_val)
 *         if self._save_bool_variables_val:
 */
  __pyx_t_4 = (((PyObject *)__pyx_v_self->_save_int_variables_val) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_self->_save_int_variables_val)) != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1339
 *             sol_real = self.get_real(self._save_real_variables_val)
 *         if self._save_int_variables_val:
 *             sol_int  = self.get_integer(self._save_int_variables_val)             # <<<<<<<<<<<<<<
 *         if self._save_bool_variables_val:
 *             sol_bool = self.get_boolean(self._save_bool_variables_val)
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_integer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->_save_int_variables_val));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_sol_int);
    __pyx_v_sol_int = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1340
 *         if self._save_int_variables_val:
 *             sol_int  = self.get_integer(self._save_int_variables_val)
 *         if self._save_bool_variables_val:             # <<<<<<<<<<<<<<
 *             sol_bool = self.get_boolean(self._save_bool_variables_val)
 * 
 */
  __pyx_t_4 = (((PyObject *)__pyx_v_self->_save_bool_variables_val) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_self->_save_bool_variables_val)) != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1341
 *             sol_int  = self.get_integer(self._save_int_variables_val)
 *         if self._save_bool_variables_val:
 *             sol_bool = self.get_boolean(self._save_bool_variables_val)             # <<<<<<<<<<<<<<
 * 
 *         return sol_real, sol_int, sol_bool
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_boolean); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->_save_bool_variables_val));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_sol_bool);
    __pyx_v_sol_bool = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":1343
 *             sol_bool = self.get_boolean(self._save_bool_variables_val)
 * 
 *         return sol_real, sol_int, sol_bool             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_sol_real);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sol_real);
  __Pyx_GIVEREF(__pyx_v_sol_real);
  __Pyx_INCREF(__pyx_v_sol_int);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_sol_int);
  __Pyx_GIVEREF(__pyx_v_sol_int);
  __Pyx_INCREF(__pyx_v_sol_bool);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_sol_bool);
  __Pyx_GIVEREF(__pyx_v_sol_bool);
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

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

    /* "pyfmi\fmi.pyx":1346
 * 
 * 
 *     def get_model_variables(self,type=None, include_alias=True,             # <<<<<<<<<<<<<<
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False):
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = __pyx_k_64;

    /* "pyfmi\fmi.pyx":1347
 * 
 *     def get_model_variables(self,type=None, include_alias=True,
 *                             causality=None,   variability=None,             # <<<<<<<<<<<<<<
 *                             only_start=False,  only_fixed=False):
 *         """
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    values[4] = __pyx_k_65;
    values[5] = __pyx_k_66;
    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 (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--; }
        }
      }
      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 = 1346; __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);
        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];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_model_variables", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __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_52get_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_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_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) {
  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;
  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;
  size_t __pyx_v_i;
  char *__pyx_v_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  enum fmi1_base_type_enu_t __pyx_t_3;
  enum fmi1_causality_enu_t __pyx_t_4;
  enum fmi1_variability_enu_t __pyx_t_5;
  size_t __pyx_t_6;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_model_variables", 0);

  /* "pyfmi\fmi.pyx":1387
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 *         cdef char* desc
 *         cdef dict variable_dict = {}             # <<<<<<<<<<<<<<
 *         cdef int  selected_type = 0 #If a type has been selected
 *         cdef int  selected_variability = 0 #If a variability has been selected
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_variable_dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1388
 *         cdef char* desc
 *         cdef dict variable_dict = {}
 *         cdef int  selected_type = 0 #If a type has been selected             # <<<<<<<<<<<<<<
 *         cdef int  selected_variability = 0 #If a variability has been selected
 *         cdef int  selected_causality = 0 #If a causality has been selected
 */
  __pyx_v_selected_type = 0;

  /* "pyfmi\fmi.pyx":1389
 *         cdef dict variable_dict = {}
 *         cdef int  selected_type = 0 #If a type has been selected
 *         cdef int  selected_variability = 0 #If a variability has been selected             # <<<<<<<<<<<<<<
 *         cdef int  selected_causality = 0 #If a causality has been selected
 *         cdef int  has_start, is_fixed
 */
  __pyx_v_selected_variability = 0;

  /* "pyfmi\fmi.pyx":1390
 *         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_causality = 0;

  /* "pyfmi\fmi.pyx":1393
 *         cdef int  has_start, is_fixed
 * 
 *         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":1394
 * 
 *         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":1396
 *         variable_list_size = FMIL.fmi1_import_get_variable_list_size(variable_list)
 * 
 *         if type!=None: #A type have has been selected             # <<<<<<<<<<<<<<
 *             target_type = type
 *             selected_type = 1
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_type, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __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 = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

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

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

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

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

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

    /* "pyfmi\fmi.pyx":1404
 *         if variability!=None: #A variability has been selected
 *             target_variability = variability
 *             selected_variability = 1             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
    __pyx_v_selected_variability = 1;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":1406
 *             selected_variability = 1
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)
 */
  __pyx_t_6 = __pyx_v_variable_list_size;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pyfmi\fmi.pyx":1408
 *         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":1410
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             name       = FMIL.fmi1_import_get_variable_name(variable)
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)
 */
    __pyx_v_alias_kind = fmi1_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1411
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = FMIL.fmi1_import_get_variable_name(variable)             # <<<<<<<<<<<<<<
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_v_name = fmi1_import_get_variable_name(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1412
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = FMIL.fmi1_import_get_variable_name(variable)
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 *             has_start  = FMIL.fmi1_import_get_variable_has_start(variable)
 */
    __pyx_v_value_ref = fmi1_import_get_variable_vr(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1413
 *             name       = FMIL.fmi1_import_get_variable_name(variable)
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 *             has_start  = FMIL.fmi1_import_get_variable_has_start(variable)
 *             data_variability = FMIL.fmi1_import_get_variability(variable)
 */
    __pyx_v_data_type = fmi1_import_get_variable_base_type(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1414
 *             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":1415
 *             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":1416
 *             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":1417
 *             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":1420
 * 
 *             #If only variables with start are wanted, check if the variable has start
 *             if only_start and has_start != 1:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_only_start); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {
      __pyx_t_8 = (__pyx_v_has_start != 1);
      __pyx_t_9 = __pyx_t_8;
    } else {
      __pyx_t_9 = __pyx_t_2;
    }
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":1421
 *             #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_L6_continue;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "pyfmi\fmi.pyx":1423
 *                 continue
 * 
 *             if only_fixed:             # <<<<<<<<<<<<<<
 *                 if has_start!=1:
 *                     continue
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_only_fixed); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_9) {

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

        /* "pyfmi\fmi.pyx":1425
 *             if only_fixed:
 *                 if has_start!=1:
 *                     continue             # <<<<<<<<<<<<<<
 *                 else:
 *                     is_fixed = FMIL.fmi1_import_get_variable_is_fixed(variable)
 */
        goto __pyx_L6_continue;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":1427
 *                     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":1428
 *                 else:
 *                     is_fixed = FMIL.fmi1_import_get_variable_is_fixed(variable)
 *                     if is_fixed !=1:             # <<<<<<<<<<<<<<
 *                         continue
 * 
 */
        __pyx_t_9 = (__pyx_v_is_fixed != 1);
        if (__pyx_t_9) {

          /* "pyfmi\fmi.pyx":1429
 *                     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_L6_continue;
          goto __pyx_L11;
        }
        __pyx_L11:;
      }
      __pyx_L10:;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "pyfmi\fmi.pyx":1431
 *                         continue
 * 
 *             if selected_type == 1 and data_type != target_type:             # <<<<<<<<<<<<<<
 *                 continue
 *             if selected_causality == 1 and data_causality != target_causality:
 */
    __pyx_t_9 = (__pyx_v_selected_type == 1);
    if (__pyx_t_9) {
      __pyx_t_2 = (__pyx_v_data_type != __pyx_v_target_type);
      __pyx_t_8 = __pyx_t_2;
    } else {
      __pyx_t_8 = __pyx_t_9;
    }
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":1432
 * 
 *             if selected_type == 1 and data_type != target_type:
 *                 continue             # <<<<<<<<<<<<<<
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue
 */
      goto __pyx_L6_continue;
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "pyfmi\fmi.pyx":1433
 *             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_8 = (__pyx_v_selected_causality == 1);
    if (__pyx_t_8) {
      __pyx_t_9 = (__pyx_v_data_causality != __pyx_v_target_causality);
      __pyx_t_2 = __pyx_t_9;
    } else {
      __pyx_t_2 = __pyx_t_8;
    }
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":1434
 *                 continue
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue             # <<<<<<<<<<<<<<
 *             if selected_variability == 1 and data_variability != target_variability:
 *                 continue
 */
      goto __pyx_L6_continue;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pyfmi\fmi.pyx":1435
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue
 *             if selected_variability == 1 and data_variability != target_variability:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_2 = (__pyx_v_selected_variability == 1);
    if (__pyx_t_2) {
      __pyx_t_8 = (__pyx_v_data_variability != __pyx_v_target_variability);
      __pyx_t_9 = __pyx_t_8;
    } else {
      __pyx_t_9 = __pyx_t_2;
    }
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":1436
 *                 continue
 *             if selected_variability == 1 and data_variability != target_variability:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if include_alias:
 */
      goto __pyx_L6_continue;
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "pyfmi\fmi.pyx":1438
 *                 continue
 * 
 *             if include_alias:             # <<<<<<<<<<<<<<
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable(name,
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_include_alias); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_9) {

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

      /* "pyfmi\fmi.pyx":1441
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable(name,
 *                                        value_ref, data_type, desc if desc!=NULL else "",             # <<<<<<<<<<<<<<
 *                                        data_variability, data_causality,
 *                                        alias_kind)
 */
      __pyx_t_10 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if ((__pyx_v_desc != NULL)) {
        __pyx_t_13 = PyBytes_FromString(__pyx_v_desc); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_13));
        __pyx_t_12 = ((PyObject *)__pyx_t_13);
        __pyx_t_13 = 0;
      } else {
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
        __pyx_t_12 = ((PyObject *)__pyx_kp_s_5);
      }

      /* "pyfmi\fmi.pyx":1442
 *                 variable_dict[name] = ScalarVariable(name,
 *                                        value_ref, data_type, desc if desc!=NULL else "",
 *                                        data_variability, data_causality,             # <<<<<<<<<<<<<<
 *                                        alias_kind)
 *             elif alias_kind ==FMIL.fmi1_variable_is_not_alias:
 */
      __pyx_t_13 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = PyInt_FromLong(__pyx_v_data_causality); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);

      /* "pyfmi\fmi.pyx":1443
 *                                        value_ref, data_type, desc if desc!=NULL else "",
 *                                        data_variability, data_causality,
 *                                        alias_kind)             # <<<<<<<<<<<<<<
 *             elif alias_kind ==FMIL.fmi1_variable_is_not_alias:
 *                 #variable_dict[name] = value_ref
 */
      __pyx_t_15 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_16 = PyTuple_New(7); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      __pyx_t_1 = 0;
      __pyx_t_10 = 0;
      __pyx_t_11 = 0;
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      __pyx_t_14 = 0;
      __pyx_t_15 = 0;
      __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable)), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;

      /* "pyfmi\fmi.pyx":1440
 *             if include_alias:
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable(name,             # <<<<<<<<<<<<<<
 *                                        value_ref, data_type, desc if desc!=NULL else "",
 *                                        data_variability, data_causality,
 */
      __pyx_t_16 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_16));
      if (PyDict_SetItem(((PyObject *)__pyx_v_variable_dict), ((PyObject *)__pyx_t_16), __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      goto __pyx_L15;
    }

    /* "pyfmi\fmi.pyx":1444
 *                                        data_variability, data_causality,
 *                                        alias_kind)
 *             elif alias_kind ==FMIL.fmi1_variable_is_not_alias:             # <<<<<<<<<<<<<<
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable(name,
 */
    __pyx_t_9 = (__pyx_v_alias_kind == fmi1_variable_is_not_alias);
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":1446
 *             elif alias_kind ==FMIL.fmi1_variable_is_not_alias:
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable(name,             # <<<<<<<<<<<<<<
 *                                        value_ref, data_type, desc if desc!=NULL else "",
 *                                        data_variability, data_causality,
 */
      __pyx_t_15 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_15));

      /* "pyfmi\fmi.pyx":1447
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable(name,
 *                                        value_ref, data_type, desc if desc!=NULL else "",             # <<<<<<<<<<<<<<
 *                                        data_variability, data_causality,
 *                                        alias_kind)
 */
      __pyx_t_16 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_14 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      if ((__pyx_v_desc != NULL)) {
        __pyx_t_12 = PyBytes_FromString(__pyx_v_desc); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_12));
        __pyx_t_13 = ((PyObject *)__pyx_t_12);
        __pyx_t_12 = 0;
      } else {
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
        __pyx_t_13 = ((PyObject *)__pyx_kp_s_5);
      }

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

      /* "pyfmi\fmi.pyx":1449
 *                                        value_ref, data_type, desc if desc!=NULL else "",
 *                                        data_variability, data_causality,
 *                                        alias_kind)             # <<<<<<<<<<<<<<
 * 
 *         #Free the variable list
 */
      __pyx_t_10 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_15));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_15));
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_15 = 0;
      __pyx_t_16 = 0;
      __pyx_t_14 = 0;
      __pyx_t_13 = 0;
      __pyx_t_12 = 0;
      __pyx_t_11 = 0;
      __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":1446
 *             elif alias_kind ==FMIL.fmi1_variable_is_not_alias:
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable(name,             # <<<<<<<<<<<<<<
 *                                        value_ref, data_type, desc if desc!=NULL else "",
 *                                        data_variability, data_causality,
 */
      __pyx_t_1 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      if (PyDict_SetItem(((PyObject *)__pyx_v_variable_dict), ((PyObject *)__pyx_t_1), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L15;
    }
    __pyx_L15:;
    __pyx_L6_continue:;
  }

  /* "pyfmi\fmi.pyx":1452
 * 
 *         #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":1454
 *         FMIL.fmi1_import_free_variable_list(variable_list)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_variable_dict));
  __pyx_r = ((PyObject *)__pyx_v_variable_dict);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_54get_variable_alias[] = " \n        Return a dict of all alias variables belonging to the provided variable\n        where the key are the names and the value indicating whether the variable\n        should be negated or not.\n        \n        Returns::\n            \n            A dict consisting of the alias variables along with no alias variable.\n            The values indicates wheter or not the variable should be negated or not.\n            \n        Raises:: \n        \n            FMUException if the variable is not in the model.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_alias (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = PyBytes_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_alias(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1457
 * 
 * 
 *     def get_variable_alias(self,char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Return a dict of all alias variables belonging to the provided variable
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  fmi1_import_variable_t *__pyx_v_variable;
  struct fmi1_import_variable_list_t *__pyx_v_alias_list;
  size_t __pyx_v_alias_list_size;
  enum fmi1_variable_alias_kind_enu_t __pyx_v_alias_kind;
  PyObject *__pyx_v_ret_values = 0;
  size_t __pyx_v_i;
  char *__pyx_v_alias_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_alias", 0);

  /* "pyfmi\fmi.pyx":1476
 *         cdef FMIL.size_t alias_list_size
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 *         cdef dict ret_values = {}             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_ret_values = __pyx_t_1;
  __pyx_t_1 = 0;

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

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

    /* "pyfmi\fmi.pyx":1480
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         alias_list = FMIL.fmi1_import_get_variable_aliases(self._fmu, variable)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1482
 *             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":1484
 *         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":1487
 * 
 *         #Loop over all the alias variables
 *         for i in range(alias_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi1_import_get_variable(alias_list, i)
 */
  __pyx_t_5 = __pyx_v_alias_list_size;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "pyfmi\fmi.pyx":1489
 *         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":1491
 *             variable = FMIL.fmi1_import_get_variable(alias_list, i)
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             alias_name = FMIL.fmi1_import_get_variable_name(variable)
 * 
 */
    __pyx_v_alias_kind = fmi1_import_get_variable_alias_kind(__pyx_v_variable);

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

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

  /* "pyfmi\fmi.pyx":1497
 * 
 *         #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":1499
 *         FMIL.fmi1_import_free_variable_list(alias_list)
 * 
 *         return ret_values             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_variability_enu_t get_variable_variability(self,char* variablename) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret_values));
  __pyx_r = ((PyObject *)__pyx_v_ret_values);
  goto __pyx_L0;

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

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

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static enum fmi1_variability_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_variability_enu_t __pyx_v_variability;
  enum fmi1_variability_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  enum fmi1_variability_enu_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_variability", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_67); 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);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_variability)) {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_4 = ((enum fmi1_variability_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

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

    /* "pyfmi\fmi.pyx":1521
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         variability = FMIL.fmi1_import_get_variability(variable)
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1522
 *         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":1524
 *         variability = FMIL.fmi1_import_get_variability(variable)
 * 
 *         return variability             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_by_valueref(self, FMIL.fmi1_value_reference_t valueref, type=0):
 */
  __pyx_r = __pyx_v_variability;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_56get_variable_variability[] = " \n        Get variability of variable. \n            \n        Parameters::\n        \n            variablename --\n            \n                The name of the variable.\n                    \n        Returns::\n        \n            The variability of the variable, CONTINUOUS(3), CONSTANT(0), \n            PARAMETER(1) or DISCRETE(2)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_variability (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = PyBytes_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_variability", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_56get_variable_variability(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_56get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fmi1_variability_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_variability", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_vtab)->get_variable_variability(__pyx_v_self, __pyx_v_variablename, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __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 = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_59get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_58get_variable_by_valueref[] = "\n        Get the name of a variable given a value reference. Note that it \n        returns the no-aliased variable.\n        \n        Parameters::\n        \n            valueref --\n                The value reference of the variable\n            \n            type --\n                The type of the variables (Real==0, Int==1, Bool=2,\n                String==3, Enumeration==4). Default 0 (i.e Real).\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_59get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  fmi1_value_reference_t __pyx_v_valueref;
  PyObject *__pyx_v_type = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__type,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_by_valueref (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_variable_by_valueref") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_valueref = __Pyx_PyInt_from_py_fmi1_value_reference_t(values[0]); if (unlikely((__pyx_v_valueref == (fmi1_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __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 = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_by_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_58get_variable_by_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_type);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1526
 *         return variability
 * 
 *     def get_variable_by_valueref(self, FMIL.fmi1_value_reference_t valueref, type=0):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of a variable given a value reference. Note that it
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_58get_variable_by_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, fmi1_value_reference_t __pyx_v_valueref, PyObject *__pyx_v_type) {
  fmi1_import_variable_t *__pyx_v_variable;
  char *__pyx_v_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fmi1_base_type_enu_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_by_valueref", 0);

  /* "pyfmi\fmi.pyx":1542
 *         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 = 1542; __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":1543
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, type, valueref)
 *         if variable==NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)
 * 
 */
  __pyx_t_2 = (__pyx_v_variable == NULL);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":1544
 *         variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, type, valueref)
 *         if variable==NULL:
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)             # <<<<<<<<<<<<<<
 * 
 *         name = FMIL.fmi1_import_get_variable_name(variable)
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_valueref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_68), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

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

  /* "pyfmi\fmi.pyx":1548
 *         name = FMIL.fmi1_import_get_variable_name(variable)
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_causality_enu_t get_variable_causality(self, char* variablename) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_r = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

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

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

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static enum fmi1_causality_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_causality_enu_t __pyx_v_causality;
  enum fmi1_causality_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  enum fmi1_causality_enu_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_causality", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_69); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_variable_causality)) {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_4 = ((enum fmi1_causality_enu_t)PyInt_AsLong(__pyx_t_2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

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

    /* "pyfmi\fmi.pyx":1569
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         causality = FMIL.fmi1_import_get_causality(variable)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1571
 *             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":1573
 *         causality = FMIL.fmi1_import_get_causality(variable)
 * 
 *         return causality             # <<<<<<<<<<<<<<
 * 
 *     def get_name(self):
 */
  __pyx_r = __pyx_v_causality;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_60get_variable_causality[] = "\n        Get the causality of the variable.\n        \n        Parameters::\n        \n            variablename --\n                The name of the variable.\n                \n        Returns::\n        \n            The variability of the variable, INPUT(0), OUTPUT(1),\n            INTERNAL(2), NONE(3)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_causality (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = PyBytes_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_causality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_60get_variable_causality(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_60get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, char *__pyx_v_variablename) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fmi1_causality_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_causality", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_vtab)->get_variable_causality(__pyx_v_self, __pyx_v_variablename, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __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 = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_63get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_62get_name[] = " \n        Return the model name as used in the modeling environment.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_63get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_name (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_62get_name(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* "pyfmi\fmi.pyx":1579
 *         Return the model name as used in the modeling environment.
 *         """
 *         return self._modelname             # <<<<<<<<<<<<<<
 * 
 *     def get_identifier(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_modelname);
  __pyx_r = __pyx_v_self->_modelname;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_64get_identifier[] = " \n        Return the model identifier, name of binary model file and prefix in \n        the C-function names of the model. \n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_identifier (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_64get_identifier(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1581
 *         return self._modelname
 * 
 *     def get_identifier(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model identifier, name of binary model file and prefix in
 */

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

  /* "pyfmi\fmi.pyx":1586
 *         the C-function names of the model.
 *         """
 *         return self._modelid             # <<<<<<<<<<<<<<
 * 
 *     def get_author(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_modelid);
  __pyx_r = __pyx_v_self->_modelid;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_author(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_66get_author[] = "\n        Return the name and organization of the model author.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_author(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_author (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_66get_author(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* "pyfmi\fmi.pyx":1593
 *         """
 *         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":1594
 *         cdef char* author
 *         author = FMIL.fmi1_import_get_author(self._fmu)
 *         return author if author != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_description(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_author != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_author); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_5);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_68get_description[] = "\n        Return the model description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_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_68get_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_68get_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":1601
 *         """
 *         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":1602
 *         cdef char* desc
 *         desc = FMIL.fmi1_import_get_description(self._fmu)
 *         return desc if desc != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_generation_tool(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_desc != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_desc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_5);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_generation_tool(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_70get_generation_tool[] = "\n        Return the model generation tool.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_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_70get_generation_tool(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_70get_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":1609
 *         """
 *         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":1610
 *         cdef char* gen
 *         gen = FMIL.fmi1_import_get_generation_tool(self._fmu)
 *         return gen if gen != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_guid(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_gen != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_gen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_5);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_73get_guid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_72get_guid[] = "\n        Return the model GUID.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_73get_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_72get_guid(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

  /* "pyfmi\fmi.pyx":1617
 *         """
 *         guid = FMIL.fmi1_import_get_GUID(self._fmu)
 *         return guid             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_guid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":380
 * 
 *     #Internal values
 *     cdef public object __t             # <<<<<<<<<<<<<<
 *     cdef public object _file_open
 *     cdef public object _npoints
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__t);
  __pyx_r = __pyx_v_self->__t;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->__t);
  __Pyx_DECREF(__pyx_v_self->__t);
  __pyx_v_self->__t = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->__t);
  __Pyx_DECREF(__pyx_v_self->__t);
  __pyx_v_self->__t = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":381
 *     #Internal values
 *     cdef public object __t
 *     cdef public object _file_open             # <<<<<<<<<<<<<<
 *     cdef public object _npoints
 *     cdef public object _enable_logging
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_file_open);
  __pyx_r = __pyx_v_self->_file_open;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_file_open);
  __Pyx_DECREF(__pyx_v_self->_file_open);
  __pyx_v_self->_file_open = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_file_open);
  __Pyx_DECREF(__pyx_v_self->_file_open);
  __pyx_v_self->_file_open = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":382
 *     cdef public object __t
 *     cdef public object _file_open
 *     cdef public object _npoints             # <<<<<<<<<<<<<<
 *     cdef public object _enable_logging
 *     cdef public object _pyEventInfo
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_npoints);
  __pyx_r = __pyx_v_self->_npoints;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_npoints);
  __Pyx_DECREF(__pyx_v_self->_npoints);
  __pyx_v_self->_npoints = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_npoints);
  __Pyx_DECREF(__pyx_v_self->_npoints);
  __pyx_v_self->_npoints = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":383
 *     cdef public object _file_open
 *     cdef public object _npoints
 *     cdef public object _enable_logging             # <<<<<<<<<<<<<<
 *     cdef public object _pyEventInfo
 *     cdef list _log
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_enable_logging);
  __pyx_r = __pyx_v_self->_enable_logging;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_enable_logging);
  __Pyx_DECREF(__pyx_v_self->_enable_logging);
  __pyx_v_self->_enable_logging = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_enable_logging);
  __Pyx_DECREF(__pyx_v_self->_enable_logging);
  __pyx_v_self->_enable_logging = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":384
 *     cdef public object _npoints
 *     cdef public object _enable_logging
 *     cdef public object _pyEventInfo             # <<<<<<<<<<<<<<
 *     cdef list _log
 *     cdef int _version
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_pyEventInfo);
  __pyx_r = __pyx_v_self->_pyEventInfo;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_pyEventInfo);
  __Pyx_DECREF(__pyx_v_self->_pyEventInfo);
  __pyx_v_self->_pyEventInfo = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_pyEventInfo);
  __Pyx_DECREF(__pyx_v_self->_pyEventInfo);
  __pyx_v_self->_pyEventInfo = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":393
 *     cdef unsigned int _nEventIndicators
 *     cdef unsigned int _nContinuousStates
 *     cdef public list _save_real_variables_val             # <<<<<<<<<<<<<<
 *     cdef public list _save_int_variables_val
 *     cdef public list _save_bool_variables_val
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
  __pyx_r = ((PyObject *)__pyx_v_self->_save_real_variables_val);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_save_real_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
  __pyx_v_self->_save_real_variables_val = ((PyObject*)__pyx_v_value);

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_save_real_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
  __pyx_v_self->_save_real_variables_val = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":394
 *     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 public object _fmu_temp_dir
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
  __pyx_r = ((PyObject *)__pyx_v_self->_save_int_variables_val);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_save_int_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
  __pyx_v_self->_save_int_variables_val = ((PyObject*)__pyx_v_value);

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_save_int_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
  __pyx_v_self->_save_int_variables_val = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":395
 *     cdef public list _save_real_variables_val
 *     cdef public list _save_int_variables_val
 *     cdef public list _save_bool_variables_val             # <<<<<<<<<<<<<<
 *     cdef public object _fmu_temp_dir
 *     cdef int _fmu_kind
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
  __pyx_r = ((PyObject *)__pyx_v_self->_save_bool_variables_val);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_save_bool_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
  __pyx_v_self->_save_bool_variables_val = ((PyObject*)__pyx_v_value);

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_save_bool_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
  __pyx_v_self->_save_bool_variables_val = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":396
 *     cdef public list _save_int_variables_val
 *     cdef public list _save_bool_variables_val
 *     cdef public object _fmu_temp_dir             # <<<<<<<<<<<<<<
 *     cdef int _fmu_kind
 * 
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir___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->_fmu_temp_dir);
  __pyx_r = __pyx_v_self->_fmu_temp_dir;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_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_13_fmu_temp_dir_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_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->_fmu_temp_dir);
  __Pyx_DECREF(__pyx_v_self->_fmu_temp_dir);
  __pyx_v_self->_fmu_temp_dir = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_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->_fmu_temp_dir);
  __Pyx_DECREF(__pyx_v_self->_fmu_temp_dir);
  __pyx_v_self->_fmu_temp_dir = Py_None;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,0};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_9);
    values[2] = __pyx_k_70;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __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 = 1625; __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1625
 *     #fmiResetSlave not supported
 * 
 *     def __init__(self, fmu, path='.', enable_logging=True):             # <<<<<<<<<<<<<<
 *         #Call super
 *         FMUModelBase.__init__(self,fmu,path,enable_logging)
 */

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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":1627
 *     def __init__(self, fmu, path='.', enable_logging=True):
 *         #Call super
 *         FMUModelBase.__init__(self,fmu,path,enable_logging)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_kind != FMI_CS_STANDALONE:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelBase)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1629
 *         FMUModelBase.__init__(self,fmu,path,enable_logging)
 * 
 *         if self._fmu_kind != FMI_CS_STANDALONE:             # <<<<<<<<<<<<<<
 *             raise FMUException("This class only supports FMI 1.0 for Co-simulation.")
 * 
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_self->__pyx_base._fmu_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_CS_STANDALONE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":1630
 * 
 *         if self._fmu_kind != FMI_CS_STANDALONE:
 *             raise FMUException("This class only supports FMI 1.0 for Co-simulation.")             # <<<<<<<<<<<<<<
 * 
 *         self.instantiate_slave(logging = self._enable_logging)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_72), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __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 = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1632
 *             raise FMUException("This class only supports FMI 1.0 for Co-simulation.")
 * 
 *         self.instantiate_slave(logging = self._enable_logging)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_time(self):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__instantiate_slave); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__logging), __pyx_v_self->__pyx_base._enable_logging) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

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

/* "pyfmi\fmi.pyx":1634
 *         self.instantiate_slave(logging = self._enable_logging)
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         return self.__t
 * 
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_3_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelCS1__get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_3_get_time)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1635
 * 
 *     cpdef _get_time(self):
 *         return self.__t             # <<<<<<<<<<<<<<
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__t);
  __pyx_r = __pyx_v_self->__pyx_base.__t;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_3_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_3_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_2_get_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1634
 *         self.instantiate_slave(logging = self._enable_logging)
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         return self.__t
 * 
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_2_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->_get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyfmi\fmi.pyx":1637
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):             # <<<<<<<<<<<<<<
 *         self.__t = t
 * 
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_5_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelCS1__set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_t, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_5_set_time)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1638
 * 
 *     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 = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__t);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.__t);
  __pyx_v_self->__pyx_base.__t = __pyx_t_1;
  __pyx_t_1 = 0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_5_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_5_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t) {
  fmi1_real_t __pyx_v_t;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_time (wrapper)", 0);
  assert(__pyx_arg_t); {
    __pyx_v_t = __pyx_PyFloat_AsDouble(__pyx_arg_t); if (unlikely((__pyx_v_t == (fmi1_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_4_set_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), ((fmi1_real_t)__pyx_v_t));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1637
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):             # <<<<<<<<<<<<<<
 *         self.__t = t
 * 
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_4_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_t) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static void __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_7__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_6__dealloc__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":1646
 *     """)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

static void __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_6__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyfmi\fmi.pyx":1650
 *         Deallocate memory allocated
 *         """
 *         if self._allocated_fmu:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_terminate_slave(self._fmu)
 *             FMIL.fmi1_import_free_slave_instance(self._fmu)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_fmu); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1651
 *         """
 *         if self._allocated_fmu:
 *             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":1652
 *         if self._allocated_fmu:
 *             FMIL.fmi1_import_terminate_slave(self._fmu)
 *             FMIL.fmi1_import_free_slave_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll:
 */
    fmi1_import_free_slave_instance(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1654
 *             FMIL.fmi1_import_free_slave_instance(self._fmu)
 * 
 *         if self._allocated_dll:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_dll); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1655
 * 
 *         if self._allocated_dll:
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_xml:
 */
    fmi1_import_destroy_dllfmu(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1657
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)
 * 
 *         if self._allocated_xml:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free(self._fmu)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_xml); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1658
 * 
 *         if self._allocated_xml:
 *             FMIL.fmi1_import_free(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         #if self._fmu_temp_dir:
 */
    fmi1_import_free(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":1663
 *         #    FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 * 
 *         if self._allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(self.context)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_context); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1664
 * 
 *         if self._allocated_context:
 *             FMIL.fmi_import_free_context(self.context)             # <<<<<<<<<<<<<<
 * 
 *     def do_step(self, FMIL.fmi1_real_t current_t, FMIL.fmi1_real_t step_size, new_step=True):
 */
    fmi_import_free_context(__pyx_v_self->__pyx_base.context);
    goto __pyx_L6;
  }
  __pyx_L6:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_9do_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_8do_step[] = "\n        Performs an integrator step.\n        \n        Parameters::\n        \n            current_t --\n                    The current communication point (current time) of \n                    the master.\n            step_size --\n                    The length of the step to be taken.\n            new_step --\n                    True the last step was accepted by the master and \n                    False if not.\n                    \n        Returns::\n        \n            status --\n                    The status of function which can be checked against\n                    FMI_OK, FMI_WARNING. FMI_DISCARD, FMI_ERROR, \n                    FMI_FATAL,FMI_PENDING...\n        \n        Calls the underlying low-level function fmiDoStep.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_9do_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  fmi1_real_t __pyx_v_current_t;
  fmi1_real_t __pyx_v_step_size;
  PyObject *__pyx_v_new_step = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__current_t,&__pyx_n_s__step_size,&__pyx_n_s__new_step,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_step (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    values[2] = __pyx_k_73;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__current_t);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__step_size);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_step", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __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 = 1666; __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 = 1666; __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 = 1666; __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 = 1666; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.do_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_8do_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_current_t, __pyx_v_step_size, __pyx_v_new_step);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1666
 *             FMIL.fmi_import_free_context(self.context)
 * 
 *     def do_step(self, FMIL.fmi1_real_t current_t, FMIL.fmi1_real_t step_size, new_step=True):             # <<<<<<<<<<<<<<
 *         """
 *         Performs an integrator step.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_8do_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_current_t, fmi1_real_t __pyx_v_step_size, PyObject *__pyx_v_new_step) {
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_new_s;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_step", 0);

  /* "pyfmi\fmi.pyx":1693
 *         cdef FMIL.fmi1_boolean_t new_s
 * 
 *         if new_step:             # <<<<<<<<<<<<<<
 *             #new_s = FMI_TRUE
 *             new_s = 1
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_new_step); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

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

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

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

  /* "pyfmi\fmi.pyx":1702
 *         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":1704
 *         status = FMIL.fmi1_import_do_step(self._fmu, current_t, step_size, new_s)
 * 
 *         return status             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_11cancel_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_10cancel_step[] = "\n        Cancel a current integrator step. Can only be called if the\n        status from do_step returns FMI_PENDING.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_11cancel_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancel_step (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_10cancel_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1707
 * 
 * 
 *     def cancel_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         Cancel a current integrator step. Can only be called if the
 */

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_13get_output_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives[] = "\n        Returns the output derivatives for the specified variables. The\n        order specifies the nth-derivative.\n        \n        Parameters::\n        \n                variables --\n                        The variables for which the output derivatives\n                        should be returned.\n                order --\n                        The derivative order.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_13get_output_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variables = 0;
  fmi1_integer_t __pyx_v_order;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variables,&__pyx_n_s__order,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_output_derivatives (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variables);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__order);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_output_derivatives", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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 = 1714; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_variables = values[0];
    __pyx_v_order = __Pyx_PyInt_from_py_fmi1_integer_t(values[1]); if (unlikely((__pyx_v_order == (fmi1_integer_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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 = 1714; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.get_output_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_variables, __pyx_v_order);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1714
 *         raise NotImplementedError
 * 
 *     def get_output_derivatives(self, variables, FMIL.fmi1_integer_t order):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the output derivatives for the specified variables. The
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_variables, fmi1_integer_t __pyx_v_order) {
  int __pyx_v_status;
  unsigned int __pyx_v_max_output_derivative;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_value_refs = 0;
  PyArrayObject *__pyx_v_orders = 0;
  fmi1_import_capabilities_t *__pyx_v_fmu_capabilities;
  size_t __pyx_v_i;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_orders;
  __Pyx_Buffer __pyx_pybuffer_orders;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_value_refs;
  __Pyx_Buffer __pyx_pybuffer_value_refs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  char *__pyx_t_15;
  fmi1_value_reference_t __pyx_t_16;
  long __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  size_t __pyx_t_19;
  size_t __pyx_t_20;
  size_t __pyx_t_21;
  size_t __pyx_t_22;
  PyArrayObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_output_derivatives", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_value_refs.pybuffer.buf = NULL;
  __pyx_pybuffer_value_refs.refcount = 0;
  __pyx_pybuffernd_value_refs.data = NULL;
  __pyx_pybuffernd_value_refs.rcbuffer = &__pyx_pybuffer_value_refs;
  __pyx_pybuffer_orders.pybuffer.buf = NULL;
  __pyx_pybuffer_orders.refcount = 0;
  __pyx_pybuffernd_orders.data = NULL;
  __pyx_pybuffernd_orders.rcbuffer = &__pyx_pybuffer_orders;

  /* "pyfmi\fmi.pyx":1735
 *         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":1736
 * 
 *         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":1738
 *         max_output_derivative = FMIL.fmi1_import_get_maxOutputDerivativeOrder(fmu_capabilities)
 * 
 *         if order < 1 or order > max_output_derivative:             # <<<<<<<<<<<<<<
 *             raise FMUException("The order must be greater than zero and below the maximum output derivative support of the FMU (%d)."%max_output_derivative)
 * 
 */
  __pyx_t_1 = (__pyx_v_order < 1);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_order > __pyx_v_max_output_derivative);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1739
 * 
 *         if order < 1 or order > max_output_derivative:
 *             raise FMUException("The order must be greater than zero and below the maximum output derivative support of the FMU (%d)."%max_output_derivative)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(variables,str):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_max_output_derivative); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_74), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1741
 *             raise FMUException("The order must be greater than zero and below the maximum output derivative support of the FMU (%d)."%max_output_derivative)
 * 
 *         if isinstance(variables,str):             # <<<<<<<<<<<<<<
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()
 */
  __pyx_t_6 = ((PyObject *)((PyObject*)(&PyString_Type)));
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_variables, __pyx_t_6); 
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1742
 * 
 *         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":1743
 *         if isinstance(variables,str):
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *             orders = N.array(order, dtype=N.int32)
 *             value_refs[0] = self.get_variable_valueref(variables)
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __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 = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__uint32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__flatten); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "pyfmi\fmi.pyx":1744
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()
 *             orders = N.array(order, dtype=N.int32)             # <<<<<<<<<<<<<<
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyInt_to_py_fmi1_integer_t(__pyx_v_order); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __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 = 1744; __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":1745
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()
 *             orders = N.array(order, dtype=N.int32)
 *             value_refs[0] = self.get_variable_valueref(variables)             # <<<<<<<<<<<<<<
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 *             nref = len(variables)
 */
    __pyx_t_15 = PyBytes_AsString(__pyx_v_variables); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_t_15, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_17 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_16;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1746
 *             orders = N.array(order, dtype=N.int32)
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):             # <<<<<<<<<<<<<<
 *             nref = len(variables)
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).flatten()
 */
  __pyx_t_7 = ((PyObject *)((PyObject*)(&PyList_Type)));
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_variables, __pyx_t_7); 
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_3) {
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_variables, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = ((PyObject *)((PyObject*)(&PyString_Type)));
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_TypeCheck(__pyx_t_7, __pyx_t_8); 
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

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

    /* "pyfmi\fmi.pyx":1748
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 *             nref = len(variables)
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *             orders = N.array([0]*nref, dtype=N.int32)
 *             for i in range(nref):
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_8, __pyx_temp, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
      }
    }
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
    __pyx_t_8 = 0;
    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__flatten); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyfmi\fmi.pyx":1749
 *             nref = len(variables)
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).flatten()
 *             orders = N.array([0]*nref, dtype=N.int32)             # <<<<<<<<<<<<<<
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_5, __pyx_temp, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
      }
    }
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_6);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_fmi1_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_v_orders, &__Pyx_TypeInfo_nn_fmi1_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
        }
      }
      __pyx_pybuffernd_orders.diminfo[0].strides = __pyx_pybuffernd_orders.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_orders.diminfo[0].shape = __pyx_pybuffernd_orders.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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":1750
 *             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":1751
 *             orders = N.array([0]*nref, dtype=N.int32)
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])             # <<<<<<<<<<<<<<
 *                 orders[i] = order
 *         else:
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_variables, __pyx_v_i, sizeof(size_t)+1, __Pyx_PyInt_to_py_size_t); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_15 = PyBytes_AsString(__pyx_t_6); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_16 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_t_15, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (unlikely(__pyx_t_21 >= (size_t)__pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_16;

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

    /* "pyfmi\fmi.pyx":1754
 *                 orders[i] = order
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")             # <<<<<<<<<<<<<<
 * 
 *         values = N.array([0.0]*nref,dtype=N.float, ndmin=1)
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_76), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1756
 *             raise FMUException("The variables must either be a string or a list of strings")
 * 
 *         values = N.array([0.0]*nref,dtype=N.float, ndmin=1)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_real_output_derivatives(self._fmu, <FMIL.fmi1_value_reference_t*>value_refs.data, nref, <FMIL.fmi1_integer_t*>orders.data, <FMIL.fmi1_real_t*>values.data)
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
      __Pyx_INCREF(__pyx_t_5);
      PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__float); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_23 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_23 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "pyfmi\fmi.pyx":1758
 *         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":1760
 *         status = FMIL.fmi1_import_get_real_output_derivatives(self._fmu, <FMIL.fmi1_value_reference_t*>value_refs.data, nref, <FMIL.fmi1_integer_t*>orders.data, <FMIL.fmi1_real_t*>values.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the Real output derivatives.')
 * 
 */
  __pyx_t_2 = (__pyx_v_status != 0);
  if (__pyx_t_2) {

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

  /* "pyfmi\fmi.pyx":1763
 *             raise FMUException('Failed to get the Real output derivatives.')
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 *     def _get_types_platform(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.get_output_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_value_refs);
  __Pyx_XDECREF((PyObject *)__pyx_v_orders);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_15_get_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_14_get_types_platform[] = "\n        Returns the set of valid compatible platforms for the Model, extracted\n        from the XML.\n        \n        Returns::\n            \n            types_platform -- \n                The valid platforms.\n                \n        Example::\n        \n            model.types_platform\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_15_get_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_types_platform (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_14_get_types_platform(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1765
 *         return values
 * 
 *     def _get_types_platform(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the set of valid compatible platforms for the Model, extracted
 */

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

  /* "pyfmi\fmi.pyx":1779
 *             model.types_platform
 *         """
 *         return FMIL.fmi1_import_get_types_platform(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     types_platform = property(fget=_get_types_platform)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(fmi1_import_get_types_platform(__pyx_v_self->__pyx_base._fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_17set_input_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_16set_input_derivatives[] = "\n        Sets the input derivative order for the specified variables.\n        \n        Parameters::\n        \n                variables --\n                        The variables for which the input derivative \n                        should be set.\n                values --\n                        The actual values.\n                order --\n                        The derivative order to set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_17set_input_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variables = 0;
  PyObject *__pyx_v_values = 0;
  fmi1_integer_t __pyx_v_order;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variables,&__pyx_n_s__values,&__pyx_n_s__order,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_derivatives (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variables);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__order);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __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 = 1783; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_variables = values[0];
    __pyx_v_values = values[1];
    __pyx_v_order = __Pyx_PyInt_from_py_fmi1_integer_t(values[2]); if (unlikely((__pyx_v_order == (fmi1_integer_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __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 = 1783; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.set_input_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_16set_input_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_variables, __pyx_v_values, __pyx_v_order);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1783
 *     types_platform = property(fget=_get_types_platform)
 * 
 *     def set_input_derivatives(self, variables, values, FMIL.fmi1_integer_t order):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the input derivative order for the specified variables.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_16set_input_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_values, fmi1_integer_t __pyx_v_order) {
  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_orders = 0;
  PyArrayObject *__pyx_v_value_refs = 0;
  PyArrayObject *__pyx_v_val = 0;
  size_t __pyx_v_i;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_orders;
  __Pyx_Buffer __pyx_pybuffer_orders;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val;
  __Pyx_Buffer __pyx_pybuffer_val;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_value_refs;
  __Pyx_Buffer __pyx_pybuffer_value_refs;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyArrayObject *__pyx_t_14 = NULL;
  char *__pyx_t_15;
  fmi1_value_reference_t __pyx_t_16;
  long __pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  size_t __pyx_t_20;
  size_t __pyx_t_21;
  size_t __pyx_t_22;
  size_t __pyx_t_23;
  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":1803
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] orders
 *         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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __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 = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__flatten); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_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 = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val.diminfo[0].strides = __pyx_pybuffernd_val.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val.diminfo[0].shape = __pyx_pybuffernd_val.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_val = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

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

  /* "pyfmi\fmi.pyx":1806
 * 
 *         nref = len(val)
 *         orders = N.array([0]*nref, dtype=N.int32)             # <<<<<<<<<<<<<<
 * 
 *         fmu_capabilities = FMIL.fmi1_import_get_capabilities(self._fmu)
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __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 = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_fmi1_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_v_orders, &__Pyx_TypeInfo_nn_fmi1_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_pybuffernd_orders.diminfo[0].strides = __pyx_pybuffernd_orders.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_orders.diminfo[0].shape = __pyx_pybuffernd_orders.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_orders = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":1808
 *         orders = N.array([0]*nref, dtype=N.int32)
 * 
 *         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":1809
 * 
 *         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":1812
 *         #NOTE IS THIS THE HIGHEST ORDER OF INTERPOLATION OR SIMPLY IF IT CAN OR NOT?
 * 
 *         if order < 1:             # <<<<<<<<<<<<<<
 *             raise FMUException("The order must be greater than zero.")
 *         if not can_interpolate_inputs:
 */
  __pyx_t_13 = (__pyx_v_order < 1);
  if (__pyx_t_13) {

    /* "pyfmi\fmi.pyx":1813
 * 
 *         if order < 1:
 *             raise FMUException("The order must be greater than zero.")             # <<<<<<<<<<<<<<
 *         if not can_interpolate_inputs:
 *             raise FMUException("The FMU does not support input derivatives.")
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_80), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1814
 *         if order < 1:
 *             raise FMUException("The order must be greater than zero.")
 *         if not can_interpolate_inputs:             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU does not support input derivatives.")
 * 
 */
  __pyx_t_13 = (!__pyx_v_can_interpolate_inputs);
  if (__pyx_t_13) {

    /* "pyfmi\fmi.pyx":1815
 *             raise FMUException("The order must be greater than zero.")
 *         if not can_interpolate_inputs:
 *             raise FMUException("The FMU does not support input derivatives.")             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(variables,str):
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_82), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

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

    /* "pyfmi\fmi.pyx":1818
 * 
 *         if isinstance(variables,str):
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__uint32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":1819
 *         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_15 = PyBytes_AsString(__pyx_v_variables); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_t_15, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_17 = 0;
    __pyx_t_9 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_16;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":1820
 *             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_2 = ((PyObject *)((PyObject*)(&PyList_Type)));
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_13 = __Pyx_TypeCheck(__pyx_v_variables, __pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_13) {
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_variables, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = ((PyObject *)((PyObject*)(&PyString_Type)));
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_18 = __Pyx_TypeCheck(__pyx_t_2, __pyx_t_4); 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_19 = __pyx_t_18;
  } else {
    __pyx_t_19 = __pyx_t_13;
  }
  if (__pyx_t_19) {

    /* "pyfmi\fmi.pyx":1821
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
      }
    }
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__uint32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __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 = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_3);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":1822
 *         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])
 *                 orders[i] = order
 */
    __pyx_t_20 = __pyx_v_nref;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_i = __pyx_t_21;

      /* "pyfmi\fmi.pyx":1823
 *             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, sizeof(size_t)+1, __Pyx_PyInt_to_py_size_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_15 = PyBytes_AsString(__pyx_t_3); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_16 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_t_15, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (unlikely(__pyx_t_22 >= (size_t)__pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_16;

      /* "pyfmi\fmi.pyx":1824
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 *                 orders[i] = order             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")
 */
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (unlikely(__pyx_t_23 >= (size_t)__pyx_pybuffernd_orders.diminfo[0].shape)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi1_integer_t *, __pyx_pybuffernd_orders.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_orders.diminfo[0].strides) = __pyx_v_order;
    }
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1826
 *                 orders[i] = order
 *         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*>orders.data, <FMIL.fmi1_real_t*>val.data)
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_83), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; __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 = 1826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":1828
 *             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*>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_orders->data), ((fmi1_real_t *)__pyx_v_val->data));

  /* "pyfmi\fmi.pyx":1830
 *         status = FMIL.fmi1_import_set_real_input_derivatives(self._fmu, <FMIL.fmi1_value_reference_t*>value_refs.data, nref, <FMIL.fmi1_integer_t*>orders.data, <FMIL.fmi1_real_t*>val.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Real input derivatives.')
 * 
 */
  __pyx_t_19 = (__pyx_v_status != 0);
  if (__pyx_t_19) {

    /* "pyfmi\fmi.pyx":1831
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_85), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1831; __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 = 1831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_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_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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_19simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_18simulate[] = " \n        Compact function for model simulation.\n        \n        The simulation method depends on which algorithm is used, this can be \n        set with the function argument 'algorithm'. Options for the algorithm \n        are passed as option classes or as pure dicts. See \n        FMUModel.simulate_options for more details.\n        \n        The default algorithm for this function is FMICSAlg. \n        \n        Parameters::\n        \n            start_time --\n                Start time for the simulation.\n                Default: 0.0\n                \n            final_time --\n                Final time for the simulation.\n                Default: 1.0\n                \n            input --\n                Input signal for the simulation. The input should be a 2-tuple \n                consisting of first the names of the input variable(s) and then \n                the data matrix.\n                Default: Empty tuple.\n                \n            algorithm --\n                The algorithm which will be used for the simulation is specified \n                by passing the algorithm class as string or class object in this \n                argument. 'algorithm' can be any class which implements the \n                abstract class AlgorithmBase (found in algorithm_drivers.py). In \n                this way it is possible to write own algorithms and use them \n                with this function.\n                Default: 'FMICSAlg'\n                \n            options -- \n                The options that should be used in the algorithm. For details on \n                the options do:\n                \n                    >> myModel = FMUModel(...)\n                    >> opts = myModel.simulate_options()\n                    >> opts?\n\n                Valid values are: \n                    - A dict which gives AssimuloFMIAlgOptions with \n                      default values on all options except the ones \n                      listed in"" the dict. Empty dict will thus give all \n                      options with default values.\n                    - An options object.\n                Default: Empty dict\n        \n        Returns::\n        \n            Result object, subclass of common.algorithm_drivers.ResultBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_19simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_final_time = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start_time,&__pyx_n_s__final_time,&__pyx_n_s__input,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 0);
  {
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = __pyx_k_86;
    values[1] = __pyx_k_87;

    /* "pyfmi\fmi.pyx":1836
 *                  start_time=0.0,
 *                  final_time=1.0,
 *                  input=(),             # <<<<<<<<<<<<<<
 *                  algorithm='FMICSAlg',
 *                  options={}):
 */
    values[2] = ((PyObject *)__pyx_empty_tuple);
    values[3] = ((PyObject *)__pyx_n_s__FMICSAlg);
    values[4] = __pyx_k_88;
    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 = 1833; __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 = 1833; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_18simulate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_start_time, __pyx_v_final_time, __pyx_v_input, __pyx_v_algorithm, __pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1833
 *             raise FMUException('Failed to set the Real input derivatives.')
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time=0.0,
 *                  final_time=1.0,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_18simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("simulate", 0);

  /* "pyfmi\fmi.pyx":1894
 *             Result object, subclass of common.algorithm_drivers.ResultBase.
 *         """
 *         return self._exec_simulate_algorithm(start_time,             # <<<<<<<<<<<<<<
 *                                              final_time,
 *                                              input,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_89); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_21simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_20simulate_options[] = " \n        Get an instance of the simulate options class, prefilled with default \n        values. If called without argument then the options class for the \n        default simulation algorithm will be returned.\n        \n        Parameters::\n        \n            algorithm --\n                The algorithm for which the options class should be fetched. \n                Possible values are: 'FMICSAlg'.\n                Default: 'FMICSAlg'\n                \n        Returns::\n        \n            Options class for the algorithm specified with default values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_21simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__algorithm,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 0);
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s__FMICSAlg);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __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 = 1901; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_20simulate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_algorithm);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_20simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_algorithm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("simulate_options", 0);

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_23initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_22initialize[] = "\n        Initializes the slave.\n        \n        Parameters::\n        \n            tStart -\n            tSTop --\n            StopTimeDefined --\n            \n        Calls the low-level FMU function: fmiInstantiateSlave\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_23initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_tStart = 0;
  PyObject *__pyx_v_tStop = 0;
  PyObject *__pyx_v_StopTimeDefined = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__tStart,&__pyx_n_s__tStop,&__pyx_n_s__StopTimeDefined,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    values[0] = __pyx_k_91;
    values[1] = __pyx_k_92;
    values[2] = __pyx_k_93;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        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 = 1920; __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 = 1920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_22initialize(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_tStart, __pyx_v_tStop, __pyx_v_StopTimeDefined);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1920
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def initialize(self, tStart=0.0, tStop=1.0, StopTimeDefined=False):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the slave.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_22initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_tStart, PyObject *__pyx_v_tStop, PyObject *__pyx_v_StopTimeDefined) {
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_stopDefined;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  fmi1_real_t __pyx_t_2;
  fmi1_real_t __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("initialize", 0);

  /* "pyfmi\fmi.pyx":1935
 *         cdef FMIL.fmi1_boolean_t stopDefined
 * 
 *         if StopTimeDefined:             # <<<<<<<<<<<<<<
 *             #stopDefined = FMI_TRUE
 *             stopDefined = 1
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_StopTimeDefined); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1937
 *         if StopTimeDefined:
 *             #stopDefined = FMI_TRUE
 *             stopDefined = 1             # <<<<<<<<<<<<<<
 *         else:
 *             #stopDefined = FMI_FALSE
 */
    __pyx_v_stopDefined = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1940
 *         else:
 *             #stopDefined = FMI_FALSE
 *             stopDefined = 0             # <<<<<<<<<<<<<<
 * 
 *         self.time = tStart
 */
    __pyx_v_stopDefined = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1942
 *             stopDefined = 0
 * 
 *         self.time = tStart             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_initialize_slave(self._fmu, tStart, stopDefined, tStop)
 */
  if (PyObject_SetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time, __pyx_v_tStart) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":1944
 *         self.time = tStart
 * 
 *         status = FMIL.fmi1_import_initialize_slave(self._fmu, tStart, stopDefined, tStop)             # <<<<<<<<<<<<<<
 * 
 *         if status != FMIL.fmi1_status_ok:
 */
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_tStart); if (unlikely((__pyx_t_2 == (fmi1_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tStop); if (unlikely((__pyx_t_3 == (fmi1_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_status = fmi1_import_initialize_slave(__pyx_v_self->__pyx_base._fmu, __pyx_t_2, __pyx_v_stopDefined, __pyx_t_3);

  /* "pyfmi\fmi.pyx":1946
 *         status = FMIL.fmi1_import_initialize_slave(self._fmu, tStart, stopDefined, tStop)
 * 
 *         if status != FMIL.fmi1_status_ok:             # <<<<<<<<<<<<<<
 *             raise FMUException("The slave failed to initialize.")
 * 
 */
  __pyx_t_1 = (__pyx_v_status != fmi1_status_ok);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1947
 * 
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("The slave failed to initialize.")             # <<<<<<<<<<<<<<
 * 
 *         self._allocated_fmu = True
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_95), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1949
 *             raise FMUException("The slave failed to initialize.")
 * 
 *         self._allocated_fmu = True             # <<<<<<<<<<<<<<
 * 
 *     def instantiate_slave(self, name='Slave', logging=False):
 */
  __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._allocated_fmu);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._allocated_fmu);
  __pyx_v_self->__pyx_base._allocated_fmu = __pyx_t_5;
  __pyx_t_5 = 0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_25instantiate_slave(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_24instantiate_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_25instantiate_slave(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_logging = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__logging,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instantiate_slave (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s__Slave);
    values[1] = __pyx_k_96;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_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 = 1951; __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 = 1951; __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_24instantiate_slave(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_name, __pyx_v_logging);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* "pyfmi\fmi.pyx":1969
 *         cdef int status
 *         cdef FMIL.fmi1_boolean_t log
 *         cdef FMIL.fmi1_real_t timeout = 0.0             # <<<<<<<<<<<<<<
 *         #cdef FMIL.fmi1_boolean_t visible = FMI_FALSE
 *         cdef FMIL.fmi1_boolean_t visible = 0
 */
  __pyx_v_timeout = 0.0;

  /* "pyfmi\fmi.pyx":1971
 *         cdef FMIL.fmi1_real_t timeout = 0.0
 *         #cdef FMIL.fmi1_boolean_t visible = FMI_FALSE
 *         cdef FMIL.fmi1_boolean_t visible = 0             # <<<<<<<<<<<<<<
 *         #cdef FMIL.fmi1_boolean_t interactive = FMI_FALSE
 *         cdef FMIL.fmi1_boolean_t interactive = 0
 */
  __pyx_v_visible = 0;

  /* "pyfmi\fmi.pyx":1973
 *         cdef FMIL.fmi1_boolean_t visible = 0
 *         #cdef FMIL.fmi1_boolean_t interactive = FMI_FALSE
 *         cdef FMIL.fmi1_boolean_t interactive = 0             # <<<<<<<<<<<<<<
 *         cdef object location = ""
 * 
 */
  __pyx_v_interactive = 0;

  /* "pyfmi\fmi.pyx":1974
 *         #cdef FMIL.fmi1_boolean_t interactive = FMI_FALSE
 *         cdef FMIL.fmi1_boolean_t interactive = 0
 *         cdef object location = ""             # <<<<<<<<<<<<<<
 * 
 *         if logging:
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
  __pyx_v_location = ((PyObject *)__pyx_kp_s_5);

  /* "pyfmi\fmi.pyx":1976
 *         cdef object location = ""
 * 
 *         if logging:             # <<<<<<<<<<<<<<
 *             #log = FMI_TRUE
 *             log = 1
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_logging); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

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

    /* "pyfmi\fmi.pyx":1981
 *         else:
 *             #log = FMI_FALSE
 *             log = 0             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_instantiate_slave(self._fmu, name, location,
 */
    __pyx_v_log = 0;
  }
  __pyx_L3:;

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

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

  /* "pyfmi\fmi.pyx":1985
 *         status = FMIL.fmi1_import_instantiate_slave(self._fmu, name, location,
 *                                         FMI_MIME_CS_STANDALONE, timeout, visible,
 *                                         interactive)             # <<<<<<<<<<<<<<
 * 
 *         if status != FMIL.jm_status_success:
 */
  __pyx_v_status = fmi1_import_instantiate_slave(__pyx_v_self->__pyx_base._fmu, __pyx_t_2, __pyx_t_3, __pyx_t_5, __pyx_v_timeout, __pyx_v_visible, __pyx_v_interactive);

  /* "pyfmi\fmi.pyx":1987
 *                                         interactive)
 * 
 *         if status != FMIL.jm_status_success:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to instantiate the slave.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != jm_status_success);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1988
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the slave.')             # <<<<<<<<<<<<<<
 * 
 *         #Just to be safe, some problems with Dymola (2012) FMUs not reacting
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_99), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1992
 *         #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":1994
 *         status = FMIL.fmi1_import_set_debug_logging(self._fmu, log)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the debugging option.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1995
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def get_capability_flags(self):
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_100), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.instantiate_slave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_location);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_27get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_26get_capability_flags[] = "\n        Returns a dictionary with the cability flags of the FMU.\n        \n        Capabilities::\n        \n            canHandleVariableCommunicationStepSize\n            canHandleEvents\n            canRejectSteps \n            canInterpolateInputs \n            maxOutputDerivativeOrder\n            canRunAsynchronuously\n            canSignalEvents\n            canBeinstantiatedOnlyOncePerProcess\n            canNotUseMemoryManagementFunctions\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_27get_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_26get_capability_flags(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1997
 *             raise FMUException('Failed to set the debugging option.')
 * 
 *     def get_capability_flags(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the cability flags of the FMU.
 */

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

  /* "pyfmi\fmi.pyx":2016
 *         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":2018
 *         cap = FMIL.fmi1_import_get_capabilities(self._fmu)
 * 
 *         capabilities["canHandleVariableCommunicationStepSize"] = FMIL.fmi1_import_get_canHandleVariableCommunicationStepSize(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canHandleEvents"] = FMIL.fmi1_import_get_canHandleEvents(cap)
 *         capabilities["canRejectSteps"] = FMIL.fmi1_import_get_canRejectSteps(cap)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canHandleVariableCommunicationStepSize(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_101), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2019
 * 
 *         capabilities["canHandleVariableCommunicationStepSize"] = FMIL.fmi1_import_get_canHandleVariableCommunicationStepSize(cap)
 *         capabilities["canHandleEvents"] = FMIL.fmi1_import_get_canHandleEvents(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canRejectSteps"] = FMIL.fmi1_import_get_canRejectSteps(cap)
 *         capabilities["canInterpolateInputs"] = FMIL.fmi1_import_get_canInterpolateInputs(cap)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canHandleEvents(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s__canHandleEvents), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2020
 *         capabilities["canHandleVariableCommunicationStepSize"] = FMIL.fmi1_import_get_canHandleVariableCommunicationStepSize(cap)
 *         capabilities["canHandleEvents"] = FMIL.fmi1_import_get_canHandleEvents(cap)
 *         capabilities["canRejectSteps"] = FMIL.fmi1_import_get_canRejectSteps(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canInterpolateInputs"] = FMIL.fmi1_import_get_canInterpolateInputs(cap)
 *         capabilities["maxOutputDerivativeOrder"] = FMIL.fmi1_import_get_maxOutputDerivativeOrder(cap)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canRejectSteps(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s__canRejectSteps), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2021
 *         capabilities["canHandleEvents"] = FMIL.fmi1_import_get_canHandleEvents(cap)
 *         capabilities["canRejectSteps"] = FMIL.fmi1_import_get_canRejectSteps(cap)
 *         capabilities["canInterpolateInputs"] = FMIL.fmi1_import_get_canInterpolateInputs(cap)             # <<<<<<<<<<<<<<
 *         capabilities["maxOutputDerivativeOrder"] = FMIL.fmi1_import_get_maxOutputDerivativeOrder(cap)
 *         capabilities["canRunAsynchronuously"] = FMIL.fmi1_import_get_canRunAsynchronuously(cap)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canInterpolateInputs(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_102), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2022
 *         capabilities["canRejectSteps"] = FMIL.fmi1_import_get_canRejectSteps(cap)
 *         capabilities["canInterpolateInputs"] = FMIL.fmi1_import_get_canInterpolateInputs(cap)
 *         capabilities["maxOutputDerivativeOrder"] = FMIL.fmi1_import_get_maxOutputDerivativeOrder(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canRunAsynchronuously"] = FMIL.fmi1_import_get_canRunAsynchronuously(cap)
 *         capabilities["canSignalEvents"] = FMIL.fmi1_import_get_canSignalEvents(cap)
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi1_import_get_maxOutputDerivativeOrder(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_103), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2023
 *         capabilities["canInterpolateInputs"] = FMIL.fmi1_import_get_canInterpolateInputs(cap)
 *         capabilities["maxOutputDerivativeOrder"] = FMIL.fmi1_import_get_maxOutputDerivativeOrder(cap)
 *         capabilities["canRunAsynchronuously"] = FMIL.fmi1_import_get_canRunAsynchronuously(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canSignalEvents"] = FMIL.fmi1_import_get_canSignalEvents(cap)
 *         capabilities["canBeInstantiatedOnlyOncePerProcess"] = FMIL.fmi1_import_get_canBeInstantiatedOnlyOncePerProcess(cap)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canRunAsynchronuously(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_104), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2024
 *         capabilities["maxOutputDerivativeOrder"] = FMIL.fmi1_import_get_maxOutputDerivativeOrder(cap)
 *         capabilities["canRunAsynchronuously"] = FMIL.fmi1_import_get_canRunAsynchronuously(cap)
 *         capabilities["canSignalEvents"] = FMIL.fmi1_import_get_canSignalEvents(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canBeInstantiatedOnlyOncePerProcess"] = FMIL.fmi1_import_get_canBeInstantiatedOnlyOncePerProcess(cap)
 *         capabilities["canNotUseMemoryManagementFunctions"] = FMIL.fmi1_import_get_canNotUseMemoryManagementFunctions(cap)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canSignalEvents(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s__canSignalEvents), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2025
 *         capabilities["canRunAsynchronuously"] = FMIL.fmi1_import_get_canRunAsynchronuously(cap)
 *         capabilities["canSignalEvents"] = FMIL.fmi1_import_get_canSignalEvents(cap)
 *         capabilities["canBeInstantiatedOnlyOncePerProcess"] = FMIL.fmi1_import_get_canBeInstantiatedOnlyOncePerProcess(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canNotUseMemoryManagementFunctions"] = FMIL.fmi1_import_get_canNotUseMemoryManagementFunctions(cap)
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canBeInstantiatedOnlyOncePerProcess(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_105), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2026
 *         capabilities["canSignalEvents"] = FMIL.fmi1_import_get_canSignalEvents(cap)
 *         capabilities["canBeInstantiatedOnlyOncePerProcess"] = FMIL.fmi1_import_get_canBeInstantiatedOnlyOncePerProcess(cap)
 *         capabilities["canNotUseMemoryManagementFunctions"] = FMIL.fmi1_import_get_canNotUseMemoryManagementFunctions(cap)             # <<<<<<<<<<<<<<
 * 
 *         return capabilities
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canNotUseMemoryManagementFunctions(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_106), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2028
 *         capabilities["canNotUseMemoryManagementFunctions"] = FMIL.fmi1_import_get_canNotUseMemoryManagementFunctions(cap)
 * 
 *         return capabilities             # <<<<<<<<<<<<<<
 * 
 * cdef class FMUModelME1(FMUModelBase):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_capabilities));
  __pyx_r = ((PyObject *)__pyx_v_capabilities);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME1_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME1_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,0};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_9);
    values[2] = __pyx_k_107;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __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 = 2035; __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2035
 *     """
 * 
 *     def __init__(self, fmu, path='.', enable_logging=True):             # <<<<<<<<<<<<<<
 *         #Call super
 *         FMUModelBase.__init__(self,fmu,path,enable_logging)
 */

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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":2037
 *     def __init__(self, fmu, path='.', enable_logging=True):
 *         #Call super
 *         FMUModelBase.__init__(self,fmu,path,enable_logging)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_kind != FMI_ME:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelBase)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":2039
 *         FMUModelBase.__init__(self,fmu,path,enable_logging)
 * 
 *         if self._fmu_kind != FMI_ME:             # <<<<<<<<<<<<<<
 *             raise FMUException("This class only supports FMI 1.0 for Model Exchange.")
 * 
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_self->__pyx_base._fmu_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_ME); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2040
 * 
 *         if self._fmu_kind != FMI_ME:
 *             raise FMUException("This class only supports FMI 1.0 for Model Exchange.")             # <<<<<<<<<<<<<<
 * 
 *         self.instantiate_model(logging = self._enable_logging)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_109), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __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 = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2042
 *             raise FMUException("This class only supports FMI 1.0 for Model Exchange.")
 * 
 *         self.instantiate_model(logging = self._enable_logging)             # <<<<<<<<<<<<<<
 * 
 *     def _get_model_types_platform(self):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__instantiate_model); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__logging), __pyx_v_self->__pyx_base._enable_logging) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_3_get_model_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_2_get_model_types_platform[] = "\n        Returns the set of valid compatible platforms for the Model, extracted\n        from the XML.\n        \n        Returns::\n            \n            model_types_platform -- \n                The valid platforms.\n                \n        Example::\n        \n            model.model_types_platform\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_3_get_model_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_model_types_platform (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_2_get_model_types_platform(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2044
 *         self.instantiate_model(logging = self._enable_logging)
 * 
 *     def _get_model_types_platform(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the set of valid compatible platforms for the Model, extracted
 */

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

  /* "pyfmi\fmi.pyx":2058
 *             model.model_types_platform
 *         """
 *         return FMIL.fmi1_import_get_model_types_platform(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     model_types_platform = property(fget=_get_model_types_platform)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(fmi1_import_get_model_types_platform(__pyx_v_self->__pyx_base._fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_5reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_4reset[] = "\n        This metod resets the FMU by first calling fmiTerminate and \n        fmiFreeModelInstance and then reloades the DLL and finally\n        reinstantiates using fmiInstantiateModel.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_5reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_4reset(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2062
 *     model_types_platform = property(fget=_get_model_types_platform)
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         This metod resets the FMU by first calling fmiTerminate and
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_4reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);

  /* "pyfmi\fmi.pyx":2068
 *         reinstantiates using fmiInstantiateModel.
 *         """
 *         if self._allocated_fmu:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_fmu); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2069
 *         """
 *         if self._allocated_fmu:
 *             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":2070
 *         if self._allocated_fmu:
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             FMIL.fmi1_import_free_model_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll:
 */
    fmi1_import_free_model_instance(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2072
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 * 
 *         if self._allocated_dll:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_dll); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2073
 * 
 *         if self._allocated_dll:
 *             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":2076
 * 
 *         global FMI_REGISTER_GLOBALLY
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);             # <<<<<<<<<<<<<<
 *         if status == FMIL.jm_status_error:
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_22); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __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":2077
 *         global FMI_REGISTER_GLOBALLY
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);
 *         if status == FMIL.jm_status_error:             # <<<<<<<<<<<<<<
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs
 */
  __pyx_t_1 = (__pyx_v_status == jm_status_error);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2078
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);
 *         if status == FMIL.jm_status_error:
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")             # <<<<<<<<<<<<<<
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_111), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; __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 = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":2079
 *         if status == FMIL.jm_status_error:
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s_22); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __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 = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_22, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

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

  /* "pyfmi\fmi.pyx":2086
 *         #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":2087
 *         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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._log);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base._log));
  __pyx_v_self->__pyx_base._log = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2090
 * 
 *         #Instantiates the model
 *         self.instantiate_model(logging = self._enable_logging)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__instantiate_model); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __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 = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__logging), __pyx_v_self->__pyx_base._enable_logging) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

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

/* Python wrapper */
static void __pyx_pw_5pyfmi_3fmi_11FMUModelME1_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5pyfmi_3fmi_11FMUModelME1_7__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_5pyfmi_3fmi_11FMUModelME1_6__dealloc__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":2093
 * 
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

static void __pyx_pf_5pyfmi_3fmi_11FMUModelME1_6__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyfmi\fmi.pyx":2097
 *         Deallocate memory allocated
 *         """
 *         if self._allocated_fmu:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_fmu); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2098
 *         """
 *         if self._allocated_fmu:
 *             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":2099
 *         if self._allocated_fmu:
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             FMIL.fmi1_import_free_model_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll:
 */
    fmi1_import_free_model_instance(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2101
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 * 
 *         if self._allocated_dll:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_dll); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2102
 * 
 *         if self._allocated_dll:
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_xml:
 */
    fmi1_import_destroy_dllfmu(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2104
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)
 * 
 *         if self._allocated_xml:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free(self._fmu)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_xml); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2105
 * 
 *         if self._allocated_xml:
 *             FMIL.fmi1_import_free(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         #if self._fmu_temp_dir:
 */
    fmi1_import_free(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":2110
 *         #    FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 * 
 *         if self._allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(self.context)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._allocated_context); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2111
 * 
 *         if self._allocated_context:
 *             FMIL.fmi_import_free_context(self.context)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_time(self):
 */
    fmi_import_free_context(__pyx_v_self->__pyx_base.context);
    goto __pyx_L6;
  }
  __pyx_L6:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":2113
 *             FMIL.fmi_import_free_context(self.context)
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         return self.__t
 * 
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_9_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME1__get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_9_get_time)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":2114
 * 
 *     cpdef _get_time(self):
 *         return self.__t             # <<<<<<<<<<<<<<
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__t);
  __pyx_r = __pyx_v_self->__pyx_base.__t;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_9_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_9_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_8_get_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2113
 *             FMIL.fmi_import_free_context(self.context)
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         return self.__t
 * 
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_8_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->_get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyfmi\fmi.pyx":2116
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         self.__t = t
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_11_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME1__set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, fmi1_real_t __pyx_v_t, int __pyx_skip_dispatch) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_11_set_time)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":2118
 *     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 = 2118; __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":2120
 *         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":2122
 *         status = FMIL.fmi1_import_set_time(self._fmu,t)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the time.')
 * 
 */
  __pyx_t_4 = (__pyx_v_status != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2123
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 * 
 *     time = property(_get_time,_set_time, doc =
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_113), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_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 = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_11_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_11_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t) {
  fmi1_real_t __pyx_v_t;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_time (wrapper)", 0);
  assert(__pyx_arg_t); {
    __pyx_v_t = __pyx_PyFloat_AsDouble(__pyx_arg_t); if (unlikely((__pyx_v_t == (fmi1_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_10_set_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), ((fmi1_real_t)__pyx_v_t));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2116
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         self.__t = t
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_10_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, fmi1_real_t __pyx_v_t) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_13_get_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_13_get_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_continuous_states (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_12_get_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2131
 *     """)
 * 
 *     def _get_continuous_states(self):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef N.ndarray[double, ndim=1,mode='c'] ndx = N.zeros(self._nContinuousStates, dtype=N.double)
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_12_get_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_ndx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ndx;
  __Pyx_Buffer __pyx_pybuffer_ndx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_continuous_states", 0);
  __pyx_pybuffer_ndx.pybuffer.buf = NULL;
  __pyx_pybuffer_ndx.refcount = 0;
  __pyx_pybuffernd_ndx.data = NULL;
  __pyx_pybuffernd_ndx.rcbuffer = &__pyx_pybuffer_ndx;

  /* "pyfmi\fmi.pyx":2133
 *     def _get_continuous_states(self):
 *         cdef int status
 *         cdef N.ndarray[double, ndim=1,mode='c'] ndx = N.zeros(self._nContinuousStates, dtype=N.double)             # <<<<<<<<<<<<<<
 *         status = FMIL.fmi1_import_get_continuous_states(self._fmu, <FMIL.fmi1_real_t*>ndx.data ,self._nContinuousStates)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __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 = 2133; __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 = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __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 = 2133; __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":2134
 *         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":2136
 *         status = FMIL.fmi1_import_get_continuous_states(self._fmu, <FMIL.fmi1_real_t*>ndx.data ,self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to retrieve the continuous states.')
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2137
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_115), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; __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 = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2139
 *             raise FMUException('Failed to retrieve the continuous states.')
 * 
 *         return ndx             # <<<<<<<<<<<<<<
 * 
 *     def _set_continuous_states(self, N.ndarray[FMIL.fmi1_real_t] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ndx));
  __pyx_r = ((PyObject *)__pyx_v_ndx);
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_15_set_continuous_states(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_15_set_continuous_states(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_continuous_states (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_14_set_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2141
 *         return ndx
 * 
 *     def _set_continuous_states(self, N.ndarray[FMIL.fmi1_real_t] values):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] ndx = values#N.array(values,dtype=N.double,ndmin=1).flatten()
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_14_set_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyArrayObject *__pyx_v_values) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_ndx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ndx;
  __Pyx_Buffer __pyx_pybuffer_ndx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_continuous_states", 0);
  __pyx_pybuffer_ndx.pybuffer.buf = NULL;
  __pyx_pybuffer_ndx.refcount = 0;
  __pyx_pybuffernd_ndx.data = NULL;
  __pyx_pybuffernd_ndx.rcbuffer = &__pyx_pybuffer_ndx;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; __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":2143
 *     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 = 2143; __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":2145
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] ndx = values#N.array(values,dtype=N.double,ndmin=1).flatten()
 * 
 *         if ndx.size != self._nContinuousStates:             # <<<<<<<<<<<<<<
 *             raise FMUException(
 *                 'Failed to set the new continuous states. ' \
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_ndx), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2146
 * 
 *         if ndx.size != self._nContinuousStates:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to set the new continuous states. ' \
 *                 'The number of values are not consistent with the number of '\
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_117), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; __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 = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2151
 *                 '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":2153
 *         status = FMIL.fmi1_import_set_continuous_states(self._fmu, <FMIL.fmi1_real_t*>ndx.data ,self._nContinuousStates)
 * 
 *         if status >= 3:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the new continuous states.')
 * 
 */
  __pyx_t_4 = (__pyx_v_status >= 3);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2154
 * 
 *         if status >= 3:
 *             raise FMUException('Failed to set the new continuous states.')             # <<<<<<<<<<<<<<
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_119), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __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 = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1._set_continuous_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ndx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_17_get_nominal_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_17_get_nominal_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_nominal_continuous_states (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_16_get_nominal_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2163
 *     """)
 * 
 *     def _get_nominal_continuous_states(self):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] ndx = N.zeros(self._nContinuousStates,dtype=N.double)
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_16_get_nominal_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_ndx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ndx;
  __Pyx_Buffer __pyx_pybuffer_ndx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_nominal_continuous_states", 0);
  __pyx_pybuffer_ndx.pybuffer.buf = NULL;
  __pyx_pybuffer_ndx.refcount = 0;
  __pyx_pybuffernd_ndx.data = NULL;
  __pyx_pybuffernd_ndx.rcbuffer = &__pyx_pybuffer_ndx;

  /* "pyfmi\fmi.pyx":2165
 *     def _get_nominal_continuous_states(self):
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] ndx = N.zeros(self._nContinuousStates,dtype=N.double)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_nominal_continuous_states(
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __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 = 2165; __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 = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __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 = 2165; __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":2168
 * 
 *         status = FMIL.fmi1_import_get_nominal_continuous_states(
 *                 self._fmu, <FMIL.fmi1_real_t*>ndx.data, self._nContinuousStates)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_get_nominal_continuous_states(__pyx_v_self->__pyx_base._fmu, ((fmi1_real_t *)__pyx_v_ndx->data), __pyx_v_self->__pyx_base._nContinuousStates);

  /* "pyfmi\fmi.pyx":2170
 *                 self._fmu, <FMIL.fmi1_real_t*>ndx.data, self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the nominal values.')
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

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

  /* "pyfmi\fmi.pyx":2173
 *             raise FMUException('Failed to get the nominal values.')
 * 
 *         return ndx             # <<<<<<<<<<<<<<
 * 
 *     nominal_continuous_states = property(_get_nominal_continuous_states, doc =
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ndx));
  __pyx_r = ((PyObject *)__pyx_v_ndx);
  goto __pyx_L0;

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

/* "pyfmi\fmi.pyx":2181
 *     """)
 * 
 *     cpdef get_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the derivative of the continuous states.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_19get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME1_get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_values = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_derivatives", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_derivatives); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_19get_derivatives)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":2197
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] values = N.empty(self._nContinuousStates,dtype=N.double)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_derivatives(self._fmu, <FMIL.fmi1_real_t*>values.data, self._nContinuousStates)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __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 = 2197; __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 = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __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 = 2197; __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":2199
 *         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":2201
 *         status = FMIL.fmi1_import_get_derivatives(self._fmu, <FMIL.fmi1_real_t*>values.data, self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the derivative values.')
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

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

  /* "pyfmi\fmi.pyx":2204
 *             raise FMUException('Failed to get the derivative values.')
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 *     def get_event_indicators(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_19get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_18get_derivatives[] = "\n        Returns the derivative of the continuous states.\n                \n        Returns::\n        \n            dx -- \n                The derivative as an array.\n                \n        Example::\n        \n            dx = model.get_derivatives()\n                \n        Calls the low-level FMI function: fmiGetDerivatives\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_19get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_derivatives (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_18get_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2181
 *     """)
 * 
 *     cpdef get_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the derivative of the continuous states.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_18get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_derivatives", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_derivatives(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_21get_event_indicators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_20get_event_indicators[] = "\n        Returns the event indicators at the current time-point.\n\n        Return::\n        \n            evInd -- \n                The event indicators as an array.\n                \n        Example::\n        \n            evInd = model.get_event_indicators()\n                \n        Calls the low-level FMI function: fmiGetEventIndicators\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_21get_event_indicators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_event_indicators (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_20get_event_indicators(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2206
 *         return values
 * 
 *     def get_event_indicators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event indicators at the current time-point.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_20get_event_indicators(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_values = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_event_indicators", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;

  /* "pyfmi\fmi.pyx":2222
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] values = N.empty(self._nEventIndicators,dtype=N.double)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_event_indicators(self._fmu, <FMIL.fmi1_real_t*>values.data, self._nEventIndicators)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->__pyx_base._nEventIndicators); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __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 = 2222; __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 = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __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 = 2222; __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":2224
 *         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":2226
 *         status = FMIL.fmi1_import_get_event_indicators(self._fmu, <FMIL.fmi1_real_t*>values.data, self._nEventIndicators)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the event indicators.')
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

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

  /* "pyfmi\fmi.pyx":2229
 *             raise FMUException('Failed to get the event indicators.')
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_23get_tolerances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_22get_tolerances[] = "\n        Returns the relative and absolute tolerances. If the relative tolerance\n        is defined in the XML-file it is used, otherwise a default of 1.e-4 is \n        used. The absolute tolerance is calculated and returned according to\n        the FMI specification, atol = 0.01*rtol*(nominal values of the \n        continuous states).\n                \n        Returns::\n        \n            rtol -- \n                The relative tolerance.\n                \n            atol -- \n                The absolute tolerance.\n                \n        Example::\n            \n            [rtol, atol] = model.get_tolerances()\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_23get_tolerances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_tolerances (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_22get_tolerances(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2232
 * 
 * 
 *     def get_tolerances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the relative and absolute tolerances. If the relative tolerance
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_22get_tolerances(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  double __pyx_v_rtol;
  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":2252
 *             [rtol, atol] = model.get_tolerances()
 *         """
 *         rtol = FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)             # <<<<<<<<<<<<<<
 *         atol = 0.01*rtol*self.nominal_continuous_states
 * 
 */
  __pyx_v_rtol = fmi1_import_get_default_experiment_tolerance(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":2253
 *         """
 *         rtol = FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)
 *         atol = 0.01*rtol*self.nominal_continuous_states             # <<<<<<<<<<<<<<
 * 
 *         return [rtol, atol]
 */
  __pyx_t_1 = PyFloat_FromDouble((0.01 * __pyx_v_rtol)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_126); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __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":2255
 *         atol = 0.01*rtol*self.nominal_continuous_states
 * 
 *         return [rtol, atol]             # <<<<<<<<<<<<<<
 * 
 *     def event_update(self, intermediateResult=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_rtol); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; __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_INCREF(__pyx_v_atol);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_atol);
  __Pyx_GIVEREF(__pyx_v_atol);
  __pyx_t_3 = 0;
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_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_atol);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_25event_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_24event_update[] = "\n        Updates the event information at the current time-point. If \n        intermediateResult is set to True the update_event will stop at each \n        event iteration which would require to loop until \n        event_info.iterationConverged == fmiTrue.\n        \n        Parameters::\n        \n            intermediateResult -- \n                If set to True, the update_event will stop at each event \n                iteration.\n                Default: False.\n                \n        Example::\n        \n            model.event_update()\n        \n        Calls the low-level FMI function: fmiEventUpdate\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_25event_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_intermediateResult = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__intermediateResult,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("event_update (wrapper)", 0);
  {
    PyObject* values[1] = {0};
    values[0] = __pyx_k_127;
    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 = 2257; __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 = 2257; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.event_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_24event_update(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), __pyx_v_intermediateResult);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2257
 *         return [rtol, atol]
 * 
 *     def event_update(self, intermediateResult=False):             # <<<<<<<<<<<<<<
 *         """
 *         Updates the event information at the current time-point. If
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_24event_update(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_intermediateResult) {
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_intermediate_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("event_update", 0);

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

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

    /* "pyfmi\fmi.pyx":2288
 * 
 *         if status != 0:
 *             raise FMUException('Failed to update the events.')             # <<<<<<<<<<<<<<
 * 
 *     def get_event_info(self):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_129), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __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 = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_27get_event_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_26get_event_info[] = "\n        Returns the event information from the FMU. \n        \n        Returns::\n        \n            The event information, a struct which contains:\n        \n            iterationConverged -- \n                Event iteration converged (if True).\n                \n            stateValueReferencesChanged -- \n                ValueReferences of states x changed (if True).\n                \n            stateValuesChanged -- \n                Values of states x have changed (if True).\n                \n            terminateSimulation -- \n                Error, terminate simulation (if True).\n                \n            upcomingTimeEvent - \n                If True, nextEventTime is the next time event.\n                \n            nextEventTime -- \n                The next time event.\n                \n        Example::\n            \n            event_info    = model.event_info\n            nextEventTime = model.event_info.nextEventTime\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_27get_event_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_event_info (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_26get_event_info(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2290
 *             raise FMUException('Failed to update the events.')
 * 
 *     def get_event_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event information from the FMU.
 */

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

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

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

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

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

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

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

  /* "pyfmi\fmi.pyx":2329
 *         self._pyEventInfo.nextEventTime               = self._eventInfo.nextEventTime
 * 
 *         return self._pyEventInfo             # <<<<<<<<<<<<<<
 * 
 *     def get_state_value_references(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__pyx_base._pyEventInfo);
  __pyx_r = __pyx_v_self->__pyx_base._pyEventInfo;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_29get_state_value_references(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_28get_state_value_references[] = "\n        Returns the continuous states valuereferences.\n                \n        Returns::\n            \n            val -- \n                The references to the continuous states.\n                \n        Example::\n        \n            val = model.get_continuous_value_reference()\n            \n        Calls the low-level FMI function: fmiGetStateValueReferences\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_29get_state_value_references(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_state_value_references (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_28get_state_value_references(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2331
 *         return self._pyEventInfo
 * 
 *     def get_state_value_references(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the continuous states valuereferences.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_28get_state_value_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_values = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_state_value_references", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;

  /* "pyfmi\fmi.pyx":2347
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] values = N.zeros(self._nContinuousStates,dtype=N.uint32)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_state_value_references(
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __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 = 2347; __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 = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __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 = 2347; __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":2350
 * 
 *         status = FMIL.fmi1_import_get_state_value_references(
 *             self._fmu, <FMIL.fmi1_value_reference_t*>values.data, self._nContinuousStates)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_get_state_value_references(__pyx_v_self->__pyx_base._fmu, ((fmi1_value_reference_t *)__pyx_v_values->data), __pyx_v_self->__pyx_base._nContinuousStates);

  /* "pyfmi\fmi.pyx":2352
 *             self._fmu, <FMIL.fmi1_value_reference_t*>values.data, self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException(
 *                 'Failed to get the continuous state reference values.')
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

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

  /* "pyfmi\fmi.pyx":2356
 *                 'Failed to get the continuous state reference values.')
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 *     def completed_integrator_step(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_31completed_integrator_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_30completed_integrator_step[] = "\n        This method must be called by the environment after every completed step \n        of the integrator. If the return is True, then the environment must call \n        event_update() otherwise, no action is needed.\n        \n        Returns::\n        \n            True -> Call event_update().\n            False -> Do nothing.\n                \n        Calls the low-level FMI function: fmiCompletedIntegratorStep.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_31completed_integrator_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("completed_integrator_step (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_30completed_integrator_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2358
 *         return values
 * 
 *     def completed_integrator_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         This method must be called by the environment after every completed step
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_30completed_integrator_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_callEventUpdate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("completed_integrator_step", 0);

  /* "pyfmi\fmi.pyx":2374
 *         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":2376
 *         status = FMIL.fmi1_import_completed_integrator_step(self._fmu, &callEventUpdate)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to call FMI Completed Step.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2377
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         if callEventUpdate == 1:
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_134), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_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 = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2379
 *             raise FMUException('Failed to call FMI Completed Step.')
 * 
 *         if callEventUpdate == 1:             # <<<<<<<<<<<<<<
 *             return True
 *         else:
 */
  __pyx_t_1 = (__pyx_v_callEventUpdate == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2380
 * 
 *         if callEventUpdate == 1:
 *             return True             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2382
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  __pyx_L4:;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_33initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_32initialize[] = "\n        Initializes the model and computes initial values for all variables, \n        including setting the start values of variables defined with a the start \n        attribute in the XML-file. \n            \n        Parameters::\n        \n            tolControlled -- \n                If the model are going to be called by numerical solver using\n                step-size control. Boolean flag.\n            relativeTolerance --\n                If the model are controlled by a numerical solver using\n                step-size control, the same tolerance should be provided here.\n                Else the default tolerance from the XML-file are used.\n            \n        Calls the low-level FMI function: fmiInitialize.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_33initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_tolControlled = 0;
  PyObject *__pyx_v_relativeTolerance = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__tolControlled,&__pyx_n_s__relativeTolerance,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    values[0] = __pyx_k_135;

    /* "pyfmi\fmi.pyx":2385
 * 
 * 
 *     def initialize(self, tolControlled=True, relativeTolerance=None):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the model and computes initial values for all variables,
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tolControlled);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__relativeTolerance);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "initialize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __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 = 2385; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_32initialize(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), __pyx_v_tolControlled, __pyx_v_relativeTolerance);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_32initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_tolControlled, PyObject *__pyx_v_relativeTolerance) {
  char __pyx_v_tolerance_controlled;
  fmi1_real_t __pyx_v_tolerance;
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  fmi1_real_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialize", 0);

  /* "pyfmi\fmi.pyx":2407
 * 
 *         #Trying to set the initial time from the xml file, else 0.0
 *         if self.time == None:             # <<<<<<<<<<<<<<
 *             self.time = FMIL.fmi1_import_get_default_experiment_start(self._fmu)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2408
 *         #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 = 2408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyObject_SetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

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

    /* "pyfmi\fmi.pyx":2411
 * 
 *         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":2412
 *         if tolControlled:
 *             tolerance_controlled = 1
 *             if relativeTolerance == None:             # <<<<<<<<<<<<<<
 *                 tolerance = FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)
 *             else:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_relativeTolerance, Py_None, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

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

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

    /* "pyfmi\fmi.pyx":2418
 *         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":2420
 *             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":2422
 *         status = FMIL.fmi1_import_initialize(self._fmu, tolerance_controlled, tolerance, &self._eventInfo)
 * 
 *         if status == 1:             # <<<<<<<<<<<<<<
 *             if self._enable_logging:
 *                 logging.warning(
 */
  __pyx_t_3 = (__pyx_v_status == 1);
  if (__pyx_t_3) {

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

      /* "pyfmi\fmi.pyx":2424
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_137), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __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":2428
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 logging.warning('Initialize returned with a warning.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_139), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2428; __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":2431
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 *         if status > 1:             # <<<<<<<<<<<<<<
 *             if self._enable_logging:
 *                 raise FMUException(
 */
  __pyx_t_3 = (__pyx_v_status > 1);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2432
 * 
 *         if status > 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException(
 *                     'Initialize returned with a error.' \
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._enable_logging); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

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

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

  /* "pyfmi\fmi.pyx":2440
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 *         self._allocated_fmu = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._allocated_fmu);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._allocated_fmu);
  __pyx_v_self->__pyx_base._allocated_fmu = __pyx_t_2;
  __pyx_t_2 = 0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_35instantiate_model(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_34instantiate_model[] = "\n        Instantiate the model.\n        \n        Parameters::\n        \n            name -- \n                The name of the instance.\n                Default: 'Model'\n                        \n            logging -- \n                Defines if the logging should be turned on or off.\n                Default: False, no logging.\n                        \n        Calls the low-level FMI function: fmiInstantiateModel.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_35instantiate_model(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_logging = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__logging,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instantiate_model (wrapper)", 0);
  {
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s__Model);
    values[1] = __pyx_k_144;
    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 = 2443; __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 = 2443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.instantiate_model", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_34instantiate_model(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), __pyx_v_name, __pyx_v_logging);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_34instantiate_model(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_logging) {
  fmi1_boolean_t __pyx_v_log;
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  fmi1_string_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("instantiate_model", 0);

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

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

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

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

  /* "pyfmi\fmi.pyx":2473
 *         status = FMIL.fmi1_import_instantiate_model(self._fmu, name)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to instantiate the model.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

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

  /* "pyfmi\fmi.pyx":2478
 *         #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":2480
 *         status = FMIL.fmi1_import_set_debug_logging(self._fmu, log)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the debugging option.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2481
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_147), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2481; __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 = 2481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_37simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_36simulate[] = " \n        Compact function for model simulation.\n        \n        The simulation method depends on which algorithm is used, this can be \n        set with the function argument 'algorithm'. Options for the algorithm \n        are passed as option classes or as pure dicts. See \n        FMUModel.simulate_options for more details.\n        \n        The default algorithm for this function is AssimuloFMIAlg. \n        \n        Parameters::\n        \n            start_time --\n                Start time for the simulation.\n                Default: 0.0\n                \n            final_time --\n                Final time for the simulation.\n                Default: 1.0\n                \n            input --\n                Input signal for the simulation. The input should be a 2-tuple \n                consisting of first the names of the input variable(s) and then \n                the data matrix or a function. If a data matrix, the first \n                column should be a time vector and then the variable vectors as\n                columns. If instead a function, the argument should correspond\n                to time and the output the variable data. See the users-guide \n                for examples.\n                Default: Empty tuple.\n                \n            algorithm --\n                The algorithm which will be used for the simulation is specified \n                by passing the algorithm class as string or class object in this \n                argument. 'algorithm' can be any class which implements the \n                abstract class AlgorithmBase (found in algorithm_drivers.py). In \n                this way it is possible to write own algorithms and use them \n                with this function.\n                Default: 'AssimuloFMIAlg'\n                \n            options -- \n                The options that should be used in the algorithm. For details on \n                the options do:\n                \n                  ""  >> myModel = FMUModel(...)\n                    >> opts = myModel.simulate_options()\n                    >> opts?\n\n                Valid values are: \n                    - A dict which gives AssimuloFMIAlgOptions with \n                      default values on all options except the ones \n                      listed in the dict. Empty dict will thus give all \n                      options with default values.\n                    - An options object.\n                Default: Empty dict\n        \n        Returns::\n        \n            Result object, subclass of common.algorithm_drivers.ResultBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_37simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_final_time = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start_time,&__pyx_n_s__final_time,&__pyx_n_s__input,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 0);
  {
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = __pyx_k_148;
    values[1] = __pyx_k_149;

    /* "pyfmi\fmi.pyx":2486
 *                  start_time=0.0,
 *                  final_time=1.0,
 *                  input=(),             # <<<<<<<<<<<<<<
 *                  algorithm='AssimuloFMIAlg',
 *                  options={}):
 */
    values[2] = ((PyObject *)__pyx_empty_tuple);
    values[3] = ((PyObject *)__pyx_n_s__AssimuloFMIAlg);
    values[4] = __pyx_k_150;
    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 = 2483; __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 = 2483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_36simulate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), __pyx_v_start_time, __pyx_v_final_time, __pyx_v_input, __pyx_v_algorithm, __pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2483
 *             raise FMUException('Failed to set the debugging option.')
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time=0.0,
 *                  final_time=1.0,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_36simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("simulate", 0);

  /* "pyfmi\fmi.pyx":2548
 *             Result object, subclass of common.algorithm_drivers.ResultBase.
 *         """
 *         return self._exec_simulate_algorithm(start_time,             # <<<<<<<<<<<<<<
 *                                              final_time,
 *                                              input,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_89); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_39simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_38simulate_options[] = " \n        Get an instance of the simulate options class, prefilled with default \n        values. If called without argument then the options class for the \n        default simulation algorithm will be returned.\n        \n        Parameters::\n        \n            algorithm --\n                The algorithm for which the options class should be fetched. \n                Possible values are: 'AssimuloFMIAlg'.\n                Default: 'AssimuloFMIAlg'\n                \n        Returns::\n        \n            Options class for the algorithm specified with default values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_39simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__algorithm,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 0);
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s__AssimuloFMIAlg);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; __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 = 2555; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_38simulate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), __pyx_v_algorithm);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_38simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_algorithm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("simulate_options", 0);

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

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_41terminate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_40terminate[] = "\n        Calls the FMI function fmiTerminate() on the FMU. \n        After this call, any call to a function changing the state of the FMU will fail.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_41terminate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("terminate (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_40terminate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2574
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def terminate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the FMI function fmiTerminate() on the FMU.
 */

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

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

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

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_8FMUModel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_8FMUModel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,0};
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_9);
    values[2] = __pyx_k_151;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __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 = 2584; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_8FMUModel___init__(((struct __pyx_obj_5pyfmi_3fmi_FMUModel *)__pyx_v_self), __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static int __pyx_pf_5pyfmi_3fmi_8FMUModel___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModel *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":2585
 * cdef class FMUModel(FMUModelME1):
 *     def __init__(self, fmu, path='.', enable_logging=True):
 *         print "WARNING: This class is deprecated and has been superseded with FMUModelME1. The recommended entry-point for loading an FMU is now the function load_fmu."             # <<<<<<<<<<<<<<
 *         FMUModelME1.__init__(self,fmu,path,enable_logging)
 * 
 */
  if (__Pyx_PrintOne(0, ((PyObject *)__pyx_kp_s_152)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":2586
 *     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(fmu, path='.', enable_logging=True):
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME1)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

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

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_1load_fmu(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_load_fmu[] = "\n    Helper function for loading FMUs of different kinds.\n    ";
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_1load_fmu = {__Pyx_NAMESTR("load_fmu"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_1load_fmu, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_load_fmu)};
static PyObject *__pyx_pw_5pyfmi_3fmi_1load_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;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,0};
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_fmu (wrapper)", 0);
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_9);
    values[2] = __pyx_k_153;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fmu);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_fmu") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __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("load_fmu", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __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_load_fmu(__pyx_self, __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2588
 *         FMUModelME1.__init__(self,fmu,path,enable_logging)
 * 
 * def load_fmu(fmu, path='.', enable_logging=True):             # <<<<<<<<<<<<<<
 *     """
 *     Helper function for loading FMUs of different kinds.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_load_fmu(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging) {
  fmi1_callback_functions_t __pyx_v_callBackFunctions;
  struct jm_callbacks __pyx_v_callbacks;
  fmi_import_context_t *__pyx_v_context;
  fmi1_import_t *__pyx_v__fmu;
  jm_string __pyx_v_last_error;
  int __pyx_v_allocated_context;
  int __pyx_v_allocated_xml;
  PyObject *__pyx_v_fmu_temp_dir = NULL;
  PyObject *__pyx_v_fmu_full_path = NULL;
  PyObject *__pyx_v_version = NULL;
  PyObject *__pyx_v_fmu_kind = NULL;
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_model = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  jm_log_level_enu_t __pyx_t_7;
  char *__pyx_t_8;
  char *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("load_fmu", 0);

  /* "pyfmi\fmi.pyx":2604
 * 
 *     #Used for deallocation
 *     allocated_context = False             # <<<<<<<<<<<<<<
 *     allocated_xml = False
 *     fmu_temp_dir = None
 */
  __pyx_v_allocated_context = 0;

  /* "pyfmi\fmi.pyx":2605
 *     #Used for deallocation
 *     allocated_context = False
 *     allocated_xml = False             # <<<<<<<<<<<<<<
 *     fmu_temp_dir = None
 * 
 */
  __pyx_v_allocated_xml = 0;

  /* "pyfmi\fmi.pyx":2606
 *     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":2608
 *     fmu_temp_dir = None
 * 
 *     fmu_full_path = os.path.abspath(os.path.join(path,fmu))             # <<<<<<<<<<<<<<
 *     fmu_temp_dir  = create_temp_dir()
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__abspath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_fmu_full_path = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2609
 * 
 *     fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *     fmu_temp_dir  = create_temp_dir()             # <<<<<<<<<<<<<<
 * 
 *     # Check that the file referenced by fmu has the correct file-ending
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__create_temp_dir); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_v_fmu_temp_dir);
  __pyx_v_fmu_temp_dir = __pyx_t_3;
  __pyx_t_3 = 0;

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

    /* "pyfmi\fmi.pyx":2613
 *     # Check that the file referenced by fmu has the correct file-ending
 *     if not fmu_full_path.endswith(".fmu"):
 *         raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *     #Specify the general callback functions
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_155), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __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 = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2616
 * 
 *     #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":2617
 *     #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":2618
 *     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":2619
 *     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":2620
 *     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":2621
 *     callbacks.free    = FMIL.free
 *     callbacks.logger  = importlogger_load_fmu
 *     callbacks.log_level = FMIL.jm_log_level_warning if enable_logging else FMIL.jm_log_level_nothing             # <<<<<<<<<<<<<<
 *     #callbacks.errMessageBuffer = NULL
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {
    __pyx_t_7 = jm_log_level_warning;
  } else {
    __pyx_t_7 = jm_log_level_nothing;
  }
  __pyx_v_callbacks.log_level = __pyx_t_7;

  /* "pyfmi\fmi.pyx":2625
 * 
 *     #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":2626
 *     #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":2627
 *     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":2629
 *     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":2630
 * 
 *     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":2633
 * 
 *     #Get the FMI version of the provided model
 *     version = FMIL.fmi_import_get_fmi_version(context, fmu_full_path, fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *     if version == FMIL.fmi_version_unknown_enu:
 */
  __pyx_t_8 = PyBytes_AsString(__pyx_v_fmu_full_path); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyInt_FromLong(fmi_import_get_fmi_version(__pyx_v_context, __pyx_t_8, __pyx_t_9)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_version = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":2635
 *     version = FMIL.fmi_import_get_fmi_version(context, fmu_full_path, fmu_temp_dir)
 * 
 *     if version == FMIL.fmi_version_unknown_enu:             # <<<<<<<<<<<<<<
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 * 
 */
  __pyx_t_3 = PyInt_FromLong(fmi_version_unknown_enu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_version, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":2636
 * 
 *     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":2639
 * 
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    if (__pyx_v_allocated_context) {

      /* "pyfmi\fmi.pyx":2640
 *         #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":2642
 *             FMIL.fmi_import_free_context(context)
 * 
 *         if enable_logging:             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU version could not be determined. "+last_error)
 *         else:
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":2643
 * 
 *         if enable_logging:
 *             raise FMUException("The FMU version could not be determined. "+last_error)             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_15), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":2645
 *             raise FMUException("The FMU version could not be determined. "+last_error)
 *         else:
 *             raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *     if version != 1:
 *         #Delete the context
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_156), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2645; __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 = 2645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L6:;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2646
 *         else:
 *             raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 *     if version != 1:             # <<<<<<<<<<<<<<
 *         #Delete the context
 *         if allocated_context:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_version, __pyx_int_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":2648
 *     if version != 1:
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    if (__pyx_v_allocated_context) {

      /* "pyfmi\fmi.pyx":2649
 *         #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":2651
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Parse the XML
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_157), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __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 = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":2654
 * 
 *     #Parse the XML
 *     _fmu = FMIL.fmi1_import_parse_xml(context, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *     allocated_xml = True
 * 
 */
  __pyx_t_9 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__fmu = fmi1_import_parse_xml(__pyx_v_context, __pyx_t_9);

  /* "pyfmi\fmi.pyx":2655
 *     #Parse the XML
 *     _fmu = FMIL.fmi1_import_parse_xml(context, fmu_temp_dir)
 *     allocated_xml = True             # <<<<<<<<<<<<<<
 * 
 *     #Check the FMU kind
 */
  __pyx_v_allocated_xml = 1;

  /* "pyfmi\fmi.pyx":2658
 * 
 *     #Check the FMU kind
 *     fmu_kind = FMIL.fmi1_import_get_fmu_kind(_fmu)             # <<<<<<<<<<<<<<
 *     if fmu_kind == FMI_ME:
 *         model = FMUModelME1(fmu, path, enable_logging)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_fmu_kind(__pyx_v__fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fmu_kind = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2659
 *     #Check the FMU kind
 *     fmu_kind = FMIL.fmi1_import_get_fmu_kind(_fmu)
 *     if fmu_kind == FMI_ME:             # <<<<<<<<<<<<<<
 *         model = FMUModelME1(fmu, path, enable_logging)
 *     elif fmu_kind == FMI_CS_STANDALONE:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_ME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_fmu_kind, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":2660
 *     fmu_kind = FMIL.fmi1_import_get_fmu_kind(_fmu)
 *     if fmu_kind == FMI_ME:
 *         model = FMUModelME1(fmu, path, enable_logging)             # <<<<<<<<<<<<<<
 *     elif fmu_kind == FMI_CS_STANDALONE:
 *         model = FMUModelCS1(fmu, path, enable_logging)
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_fmu);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fmu);
    __Pyx_GIVEREF(__pyx_v_fmu);
    __Pyx_INCREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    __Pyx_INCREF(__pyx_v_enable_logging);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_enable_logging);
    __Pyx_GIVEREF(__pyx_v_enable_logging);
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME1)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_model = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L9;
  }

  /* "pyfmi\fmi.pyx":2661
 *     if fmu_kind == FMI_ME:
 *         model = FMUModelME1(fmu, path, enable_logging)
 *     elif fmu_kind == FMI_CS_STANDALONE:             # <<<<<<<<<<<<<<
 *         model = FMUModelCS1(fmu, path, enable_logging)
 *     else:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_CS_STANDALONE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_fmu_kind, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":2662
 *         model = FMUModelME1(fmu, path, enable_logging)
 *     elif fmu_kind == FMI_CS_STANDALONE:
 *         model = FMUModelCS1(fmu, path, enable_logging)             # <<<<<<<<<<<<<<
 *     else:
 *         #Delete the XML
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_fmu);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fmu);
    __Pyx_GIVEREF(__pyx_v_fmu);
    __Pyx_INCREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    __Pyx_INCREF(__pyx_v_enable_logging);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_enable_logging);
    __Pyx_GIVEREF(__pyx_v_enable_logging);
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_model = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L9;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2665
 *     else:
 *         #Delete the XML
 *         if allocated_xml:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free(_fmu)
 * 
 */
    if (__pyx_v_allocated_xml) {

      /* "pyfmi\fmi.pyx":2666
 *         #Delete the XML
 *         if allocated_xml:
 *             FMIL.fmi1_import_free(_fmu)             # <<<<<<<<<<<<<<
 * 
 *         #Delete the context
 */
      fmi1_import_free(__pyx_v__fmu);
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "pyfmi\fmi.pyx":2669
 * 
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    if (__pyx_v_allocated_context) {

      /* "pyfmi\fmi.pyx":2670
 *         #Delete the context
 *         if allocated_context:
 *             FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0 for Model Exchange.")
 */
      fmi_import_free_context(__pyx_v_context);
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "pyfmi\fmi.pyx":2672
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0 for Model Exchange.")             # <<<<<<<<<<<<<<
 * 
 *     #Delete the XML
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_158), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2672; __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 = 2672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":2675
 * 
 *     #Delete the XML
 *     if allocated_xml:             # <<<<<<<<<<<<<<
 *         FMIL.fmi1_import_free(_fmu)
 * 
 */
  if (__pyx_v_allocated_xml) {

    /* "pyfmi\fmi.pyx":2676
 *     #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":2679
 * 
 *     #Delete the context
 *     if allocated_context:             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_free_context(context)
 * 
 */
  if (__pyx_v_allocated_context) {

    /* "pyfmi\fmi.pyx":2680
 *     #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_L13;
  }
  __pyx_L13:;

  /* "pyfmi\fmi.pyx":2683
 * 
 *     #Delete the created directory
 *     delete_temp_dir(fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *     return model
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__delete_temp_dir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_fmu_temp_dir);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fmu_temp_dir);
  __Pyx_GIVEREF(__pyx_v_fmu_temp_dir);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2685
 *     delete_temp_dir(fmu_temp_dir)
 * 
 *     return model             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_model));
  __pyx_r = ((PyObject *)__pyx_v_model);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.load_fmu", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmu_temp_dir);
  __Pyx_XDECREF(__pyx_v_fmu_full_path);
  __Pyx_XDECREF(__pyx_v_version);
  __Pyx_XDECREF(__pyx_v_fmu_kind);
  __Pyx_XDECREF((PyObject *)__pyx_v_model);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":193
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_copy_shape;
  int __pyx_v_i;
  int __pyx_v_ndim;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  int __pyx_v_t;
  char *__pyx_v_f;
  PyArray_Descr *__pyx_v_descr = 0;
  int __pyx_v_offset;
  int __pyx_v_hasfields;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "numpy.pxd":199
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = (__pyx_v_info == NULL);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "numpy.pxd":202
 * 
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "numpy.pxd":203
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "numpy.pxd":205
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "numpy.pxd":207
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {

    /* "numpy.pxd":208
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "numpy.pxd":210
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "numpy.pxd":212
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
  if (__pyx_t_1) {

    /* "numpy.pxd":213
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 */
    __pyx_t_2 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS));
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "numpy.pxd":214
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_160), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "numpy.pxd":216
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
  if (__pyx_t_3) {

    /* "numpy.pxd":217
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 */
    __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS));
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "numpy.pxd":218
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_162), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "numpy.pxd":220
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "numpy.pxd":221
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "numpy.pxd":222
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  if (__pyx_v_copy_shape) {

    /* "numpy.pxd":225
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));

    /* "numpy.pxd":226
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "numpy.pxd":227
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_5 = __pyx_v_ndim;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "numpy.pxd":228
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "numpy.pxd":229
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }
    goto __pyx_L7;
  }
  /*else*/ {

    /* "numpy.pxd":231
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "numpy.pxd":232
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  }
  __pyx_L7:;

  /* "numpy.pxd":233
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 */
  __pyx_v_info->suboffsets = NULL;

  /* "numpy.pxd":234
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);

  /* "numpy.pxd":235
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(__pyx_v_self));

  /* "numpy.pxd":238
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "numpy.pxd":239
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 *             cdef int offset
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self->descr));
  __pyx_v_descr = __pyx_v_self->descr;

  /* "numpy.pxd":243
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "numpy.pxd":245
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  __pyx_t_2 = (!__pyx_v_hasfields);
  if (__pyx_t_2) {
    __pyx_t_3 = (!__pyx_v_copy_shape);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_1 = __pyx_t_2;
  }
  if (__pyx_t_1) {

    /* "numpy.pxd":247
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;
    goto __pyx_L10;
  }
  /*else*/ {

    /* "numpy.pxd":250
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  }
  __pyx_L10:;

  /* "numpy.pxd":252
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 */
  __pyx_t_1 = (!__pyx_v_hasfields);
  if (__pyx_t_1) {

    /* "numpy.pxd":253
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 */
    __pyx_v_t = __pyx_v_descr->type_num;

    /* "numpy.pxd":254
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
    if (__pyx_t_1) {
      __pyx_t_2 = __pyx_v_little_endian;
    } else {
      __pyx_t_2 = __pyx_t_1;
    }
    if (!__pyx_t_2) {

      /* "numpy.pxd":255
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
      if (__pyx_t_1) {
        __pyx_t_3 = (!__pyx_v_little_endian);
        __pyx_t_7 = __pyx_t_3;
      } else {
        __pyx_t_7 = __pyx_t_1;
      }
      __pyx_t_1 = __pyx_t_7;
    } else {
      __pyx_t_1 = __pyx_t_2;
    }
    if (__pyx_t_1) {

      /* "numpy.pxd":256
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_164), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "numpy.pxd":257
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__b;
      goto __pyx_L13;
    }

    /* "numpy.pxd":258
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__B;
      goto __pyx_L13;
    }

    /* "numpy.pxd":259
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__h;
      goto __pyx_L13;
    }

    /* "numpy.pxd":260
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__H;
      goto __pyx_L13;
    }

    /* "numpy.pxd":261
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_INT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__i;
      goto __pyx_L13;
    }

    /* "numpy.pxd":262
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__I;
      goto __pyx_L13;
    }

    /* "numpy.pxd":263
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__l;
      goto __pyx_L13;
    }

    /* "numpy.pxd":264
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__L;
      goto __pyx_L13;
    }

    /* "numpy.pxd":265
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__q;
      goto __pyx_L13;
    }

    /* "numpy.pxd":266
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Q;
      goto __pyx_L13;
    }

    /* "numpy.pxd":267
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__f;
      goto __pyx_L13;
    }

    /* "numpy.pxd":268
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__d;
      goto __pyx_L13;
    }

    /* "numpy.pxd":269
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__g;
      goto __pyx_L13;
    }

    /* "numpy.pxd":270
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zf;
      goto __pyx_L13;
    }

    /* "numpy.pxd":271
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zd;
      goto __pyx_L13;
    }

    /* "numpy.pxd":272
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zg;
      goto __pyx_L13;
    }

    /* "numpy.pxd":273
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__O;
      goto __pyx_L13;
    }
    /*else*/ {

      /* "numpy.pxd":275
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_165), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L13:;

    /* "numpy.pxd":276
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "numpy.pxd":277
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "numpy.pxd":279
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0
 */
    __pyx_v_info->format = ((char *)malloc(255));

    /* "numpy.pxd":280
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = '^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "numpy.pxd":281
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "numpy.pxd":284
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)             # <<<<<<<<<<<<<<
 *                 f[0] = 0 # Terminate format string
 * 
 */
    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_9;

    /* "numpy.pxd":285
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = 0 # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = 0;
  }
  __pyx_L11:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":287
 *                 f[0] = 0 # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* "numpy.pxd":288
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = PyArray_HASFIELDS(__pyx_v_self);
  if (__pyx_t_1) {

    /* "numpy.pxd":289
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "numpy.pxd":290
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {

    /* "numpy.pxd":291
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);
    goto __pyx_L4;
  }
  __pyx_L4:;

  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":767
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "numpy.pxd":768
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":770
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "numpy.pxd":771
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":773
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "numpy.pxd":774
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":776
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "numpy.pxd":777
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":779
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "numpy.pxd":780
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":782
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  long __pyx_t_10;
  char *__pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "numpy.pxd":789
 *     cdef int delta_offset
 *     cdef tuple i
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "numpy.pxd":790
 *     cdef tuple i
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "numpy.pxd":793
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
    __Pyx_XDECREF(__pyx_v_childname);
    __pyx_v_childname = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "numpy.pxd":794
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
    __pyx_v_fields = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "numpy.pxd":795
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 */
    if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
      PyObject* sequence = ((PyObject *)__pyx_v_fields);
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2);
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_child));
    __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_new_offset);
    __pyx_v_new_offset = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "numpy.pxd":797
 *         child, new_offset = fields
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {

      /* "numpy.pxd":798
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 */
      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_167), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "numpy.pxd":800
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_6 = (__pyx_v_child->byteorder == '>');
    if (__pyx_t_6) {
      __pyx_t_7 = __pyx_v_little_endian;
    } else {
      __pyx_t_7 = __pyx_t_6;
    }
    if (!__pyx_t_7) {

      /* "numpy.pxd":801
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
      __pyx_t_6 = (__pyx_v_child->byteorder == '<');
      if (__pyx_t_6) {
        __pyx_t_8 = (!__pyx_v_little_endian);
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_6;
      }
      __pyx_t_6 = __pyx_t_9;
    } else {
      __pyx_t_6 = __pyx_t_7;
    }
    if (__pyx_t_6) {

      /* "numpy.pxd":802
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_168), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "numpy.pxd":812
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_6) break;

      /* "numpy.pxd":813
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 120;

      /* "numpy.pxd":814
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "numpy.pxd":815
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_10 = 0;
      (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1);
    }

    /* "numpy.pxd":817
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_10 = 0;
    (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize);

    /* "numpy.pxd":819
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child));
    if (__pyx_t_6) {

      /* "numpy.pxd":820
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_v_t);
      __pyx_v_t = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "numpy.pxd":821
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5);
      if (__pyx_t_6) {

        /* "numpy.pxd":822
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_170), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "numpy.pxd":825
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L11;
      }

      /* "numpy.pxd":826
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L11;
      }

      /* "numpy.pxd":827
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 104;
        goto __pyx_L11;
      }

      /* "numpy.pxd":828
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L11;
      }

      /* "numpy.pxd":829
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 105;
        goto __pyx_L11;
      }

      /* "numpy.pxd":830
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L11;
      }

      /* "numpy.pxd":831
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 108;
        goto __pyx_L11;
      }

      /* "numpy.pxd":832
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L11;
      }

      /* "numpy.pxd":833
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 113;
        goto __pyx_L11;
      }

      /* "numpy.pxd":834
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L11;
      }

      /* "numpy.pxd":835
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 102;
        goto __pyx_L11;
      }

      /* "numpy.pxd":836
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 100;
        goto __pyx_L11;
      }

      /* "numpy.pxd":837
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 103;
        goto __pyx_L11;
      }

      /* "numpy.pxd":838
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 102;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L11;
      }

      /* "numpy.pxd":839
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 100;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L11;
      }

      /* "numpy.pxd":840
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 103;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L11;
      }

      /* "numpy.pxd":841
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "numpy.pxd":843
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_165), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
        __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L11:;

      /* "numpy.pxd":844
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);
      goto __pyx_L9;
    }
    /*else*/ {

      /* "numpy.pxd":848
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
      __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_11;
    }
    __pyx_L9:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "numpy.pxd":849
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_childname);
  __Pyx_XDECREF(__pyx_v_new_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":964
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  PyObject *__pyx_v_baseptr;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "numpy.pxd":966
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
  __pyx_t_1 = (__pyx_v_base == Py_None);
  if (__pyx_t_1) {

    /* "numpy.pxd":967
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __pyx_v_baseptr = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "numpy.pxd":969
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
    Py_INCREF(__pyx_v_base);

    /* "numpy.pxd":970
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr
 */
    __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  }
  __pyx_L3:;

  /* "numpy.pxd":971
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
 *      arr.base = baseptr
 * 
 */
  Py_XDECREF(__pyx_v_arr->base);

  /* "numpy.pxd":972
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __pyx_v_arr->base = __pyx_v_baseptr;

  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":974
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "numpy.pxd":975
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr->base == NULL);
  if (__pyx_t_1) {

    /* "numpy.pxd":976
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         return <object>arr.base
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "numpy.pxd":978
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }
  __pyx_L3:;

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

static PyObject *__pyx_tp_new_5pyfmi_3fmi_BaseModel(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_BaseModel(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_BaseModel[] = {
  {__Pyx_NAMESTR("set"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9BaseModel_1set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9BaseModel_set)},
  {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9BaseModel_3get, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9BaseModel_2get)},
  {__Pyx_NAMESTR("_exec_algorithm"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9BaseModel_5_exec_algorithm, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9BaseModel_4_exec_algorithm)},
  {__Pyx_NAMESTR("_exec_simulate_algorithm"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9BaseModel_7_exec_simulate_algorithm, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9BaseModel_6_exec_simulate_algorithm)},
  {__Pyx_NAMESTR("_default_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9BaseModel_9_default_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9BaseModel_8_default_options)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_BaseModel = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_BaseModel = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_BaseModel = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_BaseModel = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_BaseModel = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.BaseModel"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_BaseModel), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_BaseModel, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_BaseModel, /*tp_as_number*/
  &__pyx_tp_as_sequence_BaseModel, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_BaseModel, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_BaseModel, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR(" \n    Abstract Model class containing base functionality.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_BaseModel, /*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_BaseModel, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_5pyfmi_3fmi_ScalarVariable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)o);
  p->_name = Py_None; Py_INCREF(Py_None);
  p->_description = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_ScalarVariable(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *p = (struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)o;
  Py_XDECREF(p->_name);
  Py_XDECREF(p->_description);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5pyfmi_3fmi_ScalarVariable(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *p = (struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)o;
  if (p->_name) {
    e = (*v)(p->_name, a); if (e) return e;
  }
  if (p->_description) {
    e = (*v)(p->_description, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pyfmi_3fmi_ScalarVariable(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *p = (struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_name);
  p->_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_description);
  p->_description = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_ScalarVariable[] = {
  {__Pyx_NAMESTR("_get_name"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_3_get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_2_get_name)},
  {__Pyx_NAMESTR("_get_value_reference"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_5_get_value_reference, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_4_get_value_reference)},
  {__Pyx_NAMESTR("_get_type"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_7_get_type, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_6_get_type)},
  {__Pyx_NAMESTR("_get_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_9_get_description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_8_get_description)},
  {__Pyx_NAMESTR("_get_variability"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_11_get_variability, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_10_get_variability)},
  {__Pyx_NAMESTR("_get_causality"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_13_get_causality, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_12_get_causality)},
  {__Pyx_NAMESTR("_get_alias"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_15_get_alias, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_14_get_alias)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ScalarVariable = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_ScalarVariable = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ScalarVariable = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ScalarVariable = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_ScalarVariable = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.ScalarVariable"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_ScalarVariable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_ScalarVariable, /*tp_as_number*/
  &__pyx_tp_as_sequence_ScalarVariable, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ScalarVariable, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_ScalarVariable, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR(" \n    Class defining data structure based on the XML element ScalarVariable.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_ScalarVariable, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_ScalarVariable, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_ScalarVariable, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5pyfmi_3fmi_14ScalarVariable_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_ScalarVariable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static 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_BaseModel(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)o);
  p->__pyx_vtab = __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase;
  p->__t = Py_None; Py_INCREF(Py_None);
  p->_file_open = Py_None; Py_INCREF(Py_None);
  p->_npoints = Py_None; Py_INCREF(Py_None);
  p->_enable_logging = Py_None; Py_INCREF(Py_None);
  p->_pyEventInfo = Py_None; Py_INCREF(Py_None);
  p->_log = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_allocated_dll = Py_None; Py_INCREF(Py_None);
  p->_allocated_context = Py_None; Py_INCREF(Py_None);
  p->_allocated_xml = Py_None; Py_INCREF(Py_None);
  p->_allocated_fmu = 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);
  p->_fmu_temp_dir = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)o;
  Py_XDECREF(p->__t);
  Py_XDECREF(p->_file_open);
  Py_XDECREF(p->_npoints);
  Py_XDECREF(p->_enable_logging);
  Py_XDECREF(p->_pyEventInfo);
  Py_XDECREF(((PyObject *)p->_log));
  Py_XDECREF(p->_allocated_dll);
  Py_XDECREF(p->_allocated_context);
  Py_XDECREF(p->_allocated_xml);
  Py_XDECREF(p->_allocated_fmu);
  Py_XDECREF(p->_allocated_list);
  Py_XDECREF(p->_modelid);
  Py_XDECREF(p->_modelname);
  Py_XDECREF(((PyObject *)p->_save_real_variables_val));
  Py_XDECREF(((PyObject *)p->_save_int_variables_val));
  Py_XDECREF(((PyObject *)p->_save_bool_variables_val));
  Py_XDECREF(p->_fmu_temp_dir);
  __pyx_tp_dealloc_5pyfmi_3fmi_BaseModel(o);
}

static int __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)o;
  if (__pyx_ptype_5pyfmi_3fmi_BaseModel->tp_traverse) {
    e = __pyx_ptype_5pyfmi_3fmi_BaseModel->tp_traverse(o, v, a); if (e) return e;
  }
  if (p->__t) {
    e = (*v)(p->__t, a); if (e) return e;
  }
  if (p->_file_open) {
    e = (*v)(p->_file_open, a); if (e) return e;
  }
  if (p->_npoints) {
    e = (*v)(p->_npoints, a); if (e) return e;
  }
  if (p->_enable_logging) {
    e = (*v)(p->_enable_logging, a); if (e) return e;
  }
  if (p->_pyEventInfo) {
    e = (*v)(p->_pyEventInfo, a); if (e) return e;
  }
  if (p->_log) {
    e = (*v)(p->_log, a); if (e) return e;
  }
  if (p->_allocated_dll) {
    e = (*v)(p->_allocated_dll, a); if (e) return e;
  }
  if (p->_allocated_context) {
    e = (*v)(p->_allocated_context, a); if (e) return e;
  }
  if (p->_allocated_xml) {
    e = (*v)(p->_allocated_xml, a); if (e) return e;
  }
  if (p->_allocated_fmu) {
    e = (*v)(p->_allocated_fmu, 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;
  }
  if (p->_fmu_temp_dir) {
    e = (*v)(p->_fmu_temp_dir, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)o;
  PyObject* tmp;
  if (__pyx_ptype_5pyfmi_3fmi_BaseModel->tp_clear) {
    __pyx_ptype_5pyfmi_3fmi_BaseModel->tp_clear(o);
  }
  tmp = ((PyObject*)p->__t);
  p->__t = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_file_open);
  p->_file_open = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_npoints);
  p->_npoints = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_enable_logging);
  p->_enable_logging = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_pyEventInfo);
  p->_pyEventInfo = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_log);
  p->_log = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_allocated_dll);
  p->_allocated_dll = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_allocated_context);
  p->_allocated_context = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_allocated_xml);
  p->_allocated_xml = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_allocated_fmu);
  p->_allocated_fmu = 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);
  tmp = ((PyObject*)p->_fmu_temp_dir);
  p->_fmu_temp_dir = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase___t(PyObject *o, void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase___t(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__file_open(PyObject *o, void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__file_open(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__npoints(PyObject *o, void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__npoints(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__enable_logging(PyObject *o, void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__enable_logging(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__pyEventInfo(PyObject *o, void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__pyEventInfo(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_real_variables_val(PyObject *o, void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_real_variables_val(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_int_variables_val(PyObject *o, void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_int_variables_val(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_bool_variables_val(PyObject *o, void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_bool_variables_val(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__fmu_temp_dir(PyObject *o, void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__fmu_temp_dir(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_13_fmu_temp_dir_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelBase[] = {
  {__Pyx_NAMESTR("get_log"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3get_log, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_2get_log)},
  {__Pyx_NAMESTR("print_log"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_5print_log, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_4print_log)},
  {__Pyx_NAMESTR("_get_version"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_7_get_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_6_get_version)},
  {__Pyx_NAMESTR("get_ode_sizes"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_9get_ode_sizes, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_8get_ode_sizes)},
  {__Pyx_NAMESTR("get_real"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_11get_real, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_10get_real)},
  {__Pyx_NAMESTR("set_real"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_13set_real, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_12set_real)},
  {__Pyx_NAMESTR("get_integer"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15get_integer, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_14get_integer)},
  {__Pyx_NAMESTR("set_integer"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_17set_integer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_16set_integer)},
  {__Pyx_NAMESTR("get_boolean"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_19get_boolean, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_18get_boolean)},
  {__Pyx_NAMESTR("set_boolean"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_21set_boolean, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_20set_boolean)},
  {__Pyx_NAMESTR("get_string"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23get_string, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_22get_string)},
  {__Pyx_NAMESTR("set_string"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_25set_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_24set_string)},
  {__Pyx_NAMESTR("set_debug_logging"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_27set_debug_logging, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_26set_debug_logging)},
  {__Pyx_NAMESTR("set_fmil_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_29set_fmil_log_level, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_28set_fmil_log_level)},
  {__Pyx_NAMESTR("_set"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_31_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_30_set)},
  {__Pyx_NAMESTR("_get"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_33_get, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_32_get)},
  {__Pyx_NAMESTR("get_variable_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35get_variable_description, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_34get_variable_description)},
  {__Pyx_NAMESTR("get_variable_data_type"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37get_variable_data_type, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_36get_variable_data_type)},
  {__Pyx_NAMESTR("get_variable_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39get_variable_valueref, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_38get_variable_valueref)},
  {__Pyx_NAMESTR("get_variable_nominal"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41get_variable_nominal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_40get_variable_nominal)},
  {__Pyx_NAMESTR("get_variable_fixed"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_fixed, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_42get_variable_fixed)},
  {__Pyx_NAMESTR("get_variable_start"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_start, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_44get_variable_start)},
  {__Pyx_NAMESTR("get_variable_max"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_max, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_46get_variable_max)},
  {__Pyx_NAMESTR("get_variable_min"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_variable_min, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_48get_variable_min)},
  {__Pyx_NAMESTR("save_time_point"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51save_time_point, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_50save_time_point)},
  {__Pyx_NAMESTR("get_model_variables"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_model_variables, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_52get_model_variables)},
  {__Pyx_NAMESTR("get_variable_alias"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_alias, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_54get_variable_alias)},
  {__Pyx_NAMESTR("get_variable_variability"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_variability, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_56get_variable_variability)},
  {__Pyx_NAMESTR("get_variable_by_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_59get_variable_by_valueref, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_58get_variable_by_valueref)},
  {__Pyx_NAMESTR("get_variable_causality"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_variable_causality, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_60get_variable_causality)},
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_63get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_62get_name)},
  {__Pyx_NAMESTR("get_identifier"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_identifier, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_64get_identifier)},
  {__Pyx_NAMESTR("get_author"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_author, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_66get_author)},
  {__Pyx_NAMESTR("get_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_68get_description)},
  {__Pyx_NAMESTR("get_generation_tool"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_generation_tool, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_70get_generation_tool)},
  {__Pyx_NAMESTR("get_guid"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_73get_guid, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_72get_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},
  {(char *)"_fmu_temp_dir", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__fmu_temp_dir, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__fmu_temp_dir, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUModelBase = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_FMUModelBase = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FMUModelBase = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUModelBase = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_FMUModelBase = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUModelBase"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_FMUModelBase, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUModelBase, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUModelBase, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUModelBase, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    An FMI Model loaded from a DLL.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUModelBase, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5pyfmi_3fmi_FMUModelBase, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5pyfmi_3fmi_12FMUModelBase_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUModelBase, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 __pyx_vtable_5pyfmi_3fmi_FMUModelCS1;

static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelCS1(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *p;
  PyObject *o = __pyx_tp_new_5pyfmi_3fmi_FMUModelBase(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase*)__pyx_vtabptr_5pyfmi_3fmi_FMUModelCS1;
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelCS1(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_7__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelCS1[] = {
  {__Pyx_NAMESTR("_get_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_3_get_time, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_set_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_5_set_time, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("do_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_9do_step, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_8do_step)},
  {__Pyx_NAMESTR("cancel_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_11cancel_step, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_10cancel_step)},
  {__Pyx_NAMESTR("get_output_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_13get_output_derivatives, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives)},
  {__Pyx_NAMESTR("_get_types_platform"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_15_get_types_platform, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_14_get_types_platform)},
  {__Pyx_NAMESTR("set_input_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_17set_input_derivatives, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_16set_input_derivatives)},
  {__Pyx_NAMESTR("simulate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_19simulate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_18simulate)},
  {__Pyx_NAMESTR("simulate_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_21simulate_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_20simulate_options)},
  {__Pyx_NAMESTR("initialize"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_23initialize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_22initialize)},
  {__Pyx_NAMESTR("instantiate_slave"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_25instantiate_slave, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_24instantiate_slave)},
  {__Pyx_NAMESTR("get_capability_flags"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_27get_capability_flags, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_26get_capability_flags)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUModelCS1 = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_FMUModelCS1 = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FMUModelCS1 = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUModelCS1 = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_FMUModelCS1 = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUModelCS1"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelCS1, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_FMUModelCS1, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUModelCS1, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUModelCS1, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUModelCS1, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUModelCS1, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUModelCS1, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME1 __pyx_vtable_5pyfmi_3fmi_FMUModelME1;

static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelME1(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *p;
  PyObject *o = __pyx_tp_new_5pyfmi_3fmi_FMUModelBase(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase*)__pyx_vtabptr_5pyfmi_3fmi_FMUModelME1;
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelME1(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_5pyfmi_3fmi_11FMUModelME1_7__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelME1[] = {
  {__Pyx_NAMESTR("_get_model_types_platform"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_3_get_model_types_platform, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_2_get_model_types_platform)},
  {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_5reset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_4reset)},
  {__Pyx_NAMESTR("_get_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_9_get_time, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_set_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_11_set_time, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_continuous_states"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_13_get_continuous_states, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_set_continuous_states"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_15_set_continuous_states, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_nominal_continuous_states"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_17_get_nominal_continuous_states, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_19get_derivatives, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_18get_derivatives)},
  {__Pyx_NAMESTR("get_event_indicators"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_21get_event_indicators, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_20get_event_indicators)},
  {__Pyx_NAMESTR("get_tolerances"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_23get_tolerances, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_22get_tolerances)},
  {__Pyx_NAMESTR("event_update"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_25event_update, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_24event_update)},
  {__Pyx_NAMESTR("get_event_info"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_27get_event_info, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_26get_event_info)},
  {__Pyx_NAMESTR("get_state_value_references"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_29get_state_value_references, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_28get_state_value_references)},
  {__Pyx_NAMESTR("completed_integrator_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_31completed_integrator_step, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_30completed_integrator_step)},
  {__Pyx_NAMESTR("initialize"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_33initialize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_32initialize)},
  {__Pyx_NAMESTR("instantiate_model"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_35instantiate_model, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_34instantiate_model)},
  {__Pyx_NAMESTR("simulate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_37simulate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_36simulate)},
  {__Pyx_NAMESTR("simulate_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_39simulate_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_38simulate_options)},
  {__Pyx_NAMESTR("terminate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_41terminate, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_40terminate)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUModelME1 = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_FMUModelME1 = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FMUModelME1 = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUModelME1 = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_FMUModelME1 = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUModelME1"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelME1, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_FMUModelME1, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUModelME1, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUModelME1, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUModelME1, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    An FMI Model loaded from a DLL.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUModelME1, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5pyfmi_3fmi_11FMUModelME1_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUModelME1, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModel __pyx_vtable_5pyfmi_3fmi_FMUModel;

static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModel(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModel *p;
  PyObject *o = __pyx_tp_new_5pyfmi_3fmi_FMUModelBase(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModel *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase*)__pyx_vtabptr_5pyfmi_3fmi_FMUModel;
  return o;
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModel[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUModel = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_FMUModel = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FMUModel = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUModel = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pyfmi_3fmi_FMUModel = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUModel"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUModel), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelME1, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_FMUModel, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUModel, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUModel, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUModel, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUModel, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5pyfmi_3fmi_8FMUModel_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUModel, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("fmi"),
    __Pyx_DOCSTR(__pyx_k_171), /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_n_s_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 1, 1},
  {&__pyx_n_s_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 0, 1, 1},
  {&__pyx_n_s_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 1, 1},
  {&__pyx_n_s_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 0, 1, 1},
  {&__pyx_n_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 1},
  {&__pyx_n_s_106, __pyx_k_106, sizeof(__pyx_k_106), 0, 0, 1, 1},
  {&__pyx_kp_s_108, __pyx_k_108, sizeof(__pyx_k_108), 0, 0, 1, 0},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_kp_s_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 1, 0},
  {&__pyx_kp_s_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 0, 1, 0},
  {&__pyx_kp_s_114, __pyx_k_114, sizeof(__pyx_k_114), 0, 0, 1, 0},
  {&__pyx_kp_s_116, __pyx_k_116, sizeof(__pyx_k_116), 0, 0, 1, 0},
  {&__pyx_kp_s_118, __pyx_k_118, sizeof(__pyx_k_118), 0, 0, 1, 0},
  {&__pyx_kp_s_120, __pyx_k_120, sizeof(__pyx_k_120), 0, 0, 1, 0},
  {&__pyx_kp_s_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 0, 1, 0},
  {&__pyx_kp_s_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 0, 1, 0},
  {&__pyx_n_s_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 1, 1},
  {&__pyx_kp_s_128, __pyx_k_128, sizeof(__pyx_k_128), 0, 0, 1, 0},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_n_s_130, __pyx_k_130, sizeof(__pyx_k_130), 0, 0, 1, 1},
  {&__pyx_kp_s_131, __pyx_k_131, sizeof(__pyx_k_131), 0, 0, 1, 0},
  {&__pyx_kp_s_133, __pyx_k_133, sizeof(__pyx_k_133), 0, 0, 1, 0},
  {&__pyx_kp_s_136, __pyx_k_136, sizeof(__pyx_k_136), 0, 0, 1, 0},
  {&__pyx_kp_s_138, __pyx_k_138, sizeof(__pyx_k_138), 0, 0, 1, 0},
  {&__pyx_kp_s_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 0, 1, 0},
  {&__pyx_kp_s_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 0, 1, 0},
  {&__pyx_kp_s_145, __pyx_k_145, sizeof(__pyx_k_145), 0, 0, 1, 0},
  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
  {&__pyx_kp_s_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 0, 1, 0},
  {&__pyx_kp_u_159, __pyx_k_159, sizeof(__pyx_k_159), 0, 1, 0, 0},
  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
  {&__pyx_kp_u_161, __pyx_k_161, sizeof(__pyx_k_161), 0, 1, 0, 0},
  {&__pyx_kp_u_163, __pyx_k_163, sizeof(__pyx_k_163), 0, 1, 0, 0},
  {&__pyx_kp_u_165, __pyx_k_165, sizeof(__pyx_k_165), 0, 1, 0, 0},
  {&__pyx_kp_u_166, __pyx_k_166, sizeof(__pyx_k_166), 0, 1, 0, 0},
  {&__pyx_kp_u_169, __pyx_k_169, sizeof(__pyx_k_169), 0, 1, 0, 0},
  {&__pyx_n_s_172, __pyx_k_172, sizeof(__pyx_k_172), 0, 0, 1, 1},
  {&__pyx_kp_s_173, __pyx_k_173, sizeof(__pyx_k_173), 0, 0, 1, 0},
  {&__pyx_kp_s_174, __pyx_k_174, sizeof(__pyx_k_174), 0, 0, 1, 0},
  {&__pyx_kp_s_175, __pyx_k_175, sizeof(__pyx_k_175), 0, 0, 1, 0},
  {&__pyx_kp_s_176, __pyx_k_176, sizeof(__pyx_k_176), 0, 0, 1, 0},
  {&__pyx_n_s_177, __pyx_k_177, sizeof(__pyx_k_177), 0, 0, 1, 1},
  {&__pyx_n_s_178, __pyx_k_178, sizeof(__pyx_k_178), 0, 0, 1, 1},
  {&__pyx_kp_s_179, __pyx_k_179, sizeof(__pyx_k_179), 0, 0, 1, 0},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_n_s_180, __pyx_k_180, sizeof(__pyx_k_180), 0, 0, 1, 1},
  {&__pyx_n_s_181, __pyx_k_181, sizeof(__pyx_k_181), 0, 0, 1, 1},
  {&__pyx_n_s_182, __pyx_k_182, sizeof(__pyx_k_182), 0, 0, 1, 1},
  {&__pyx_n_s_183, __pyx_k_183, sizeof(__pyx_k_183), 0, 0, 1, 1},
  {&__pyx_kp_s_184, __pyx_k_184, sizeof(__pyx_k_184), 0, 0, 1, 0},
  {&__pyx_n_s_185, __pyx_k_185, sizeof(__pyx_k_185), 0, 0, 1, 1},
  {&__pyx_kp_s_186, __pyx_k_186, sizeof(__pyx_k_186), 0, 0, 1, 0},
  {&__pyx_kp_s_189, __pyx_k_189, sizeof(__pyx_k_189), 0, 0, 1, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
  {&__pyx_n_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 1},
  {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
  {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
  {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
  {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
  {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
  {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0},
  {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
  {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
  {&__pyx_n_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 1},
  {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_n_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 1},
  {&__pyx_n_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 1},
  {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0},
  {&__pyx_kp_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 0},
  {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0},
  {&__pyx_kp_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 0},
  {&__pyx_kp_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 0},
  {&__pyx_kp_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 0},
  {&__pyx_kp_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 0},
  {&__pyx_n_s_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 1, 1},
  {&__pyx_kp_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 0},
  {&__pyx_n_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 1},
  {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0},
  {&__pyx_kp_s_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 0, 1, 0},
  {&__pyx_kp_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 0},
  {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0},
  {&__pyx_kp_s_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 1, 0},
  {&__pyx_kp_s_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 1, 0},
  {&__pyx_kp_s_84, __pyx_k_84, sizeof(__pyx_k_84), 0, 0, 1, 0},
  {&__pyx_n_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 1},
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
  {&__pyx_kp_s_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 1, 0},
  {&__pyx_kp_s_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 1, 0},
  {&__pyx_n_s_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 1, 1},
  {&__pyx_kp_s_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 0, 1, 0},
  {&__pyx_n_s__AlgorithmBase, __pyx_k__AlgorithmBase, sizeof(__pyx_k__AlgorithmBase), 0, 0, 1, 1},
  {&__pyx_n_s__AssimuloFMIAlg, __pyx_k__AssimuloFMIAlg, sizeof(__pyx_k__AssimuloFMIAlg), 0, 0, 1, 1},
  {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
  {&__pyx_n_s__FMICSAlg, __pyx_k__FMICSAlg, sizeof(__pyx_k__FMICSAlg), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_ALIAS, __pyx_k__FMI_ALIAS, sizeof(__pyx_k__FMI_ALIAS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_BOOLEAN, __pyx_k__FMI_BOOLEAN, sizeof(__pyx_k__FMI_BOOLEAN), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_CONSTANT, __pyx_k__FMI_CONSTANT, sizeof(__pyx_k__FMI_CONSTANT), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_CONTINUOUS, __pyx_k__FMI_CONTINUOUS, sizeof(__pyx_k__FMI_CONTINUOUS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_CS_STANDALONE, __pyx_k__FMI_CS_STANDALONE, sizeof(__pyx_k__FMI_CS_STANDALONE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_DERIVATIVES, __pyx_k__FMI_DERIVATIVES, sizeof(__pyx_k__FMI_DERIVATIVES), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_DISCARD, __pyx_k__FMI_DISCARD, sizeof(__pyx_k__FMI_DISCARD), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_DISCRETE, __pyx_k__FMI_DISCRETE, sizeof(__pyx_k__FMI_DISCRETE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_ENUMERATION, __pyx_k__FMI_ENUMERATION, sizeof(__pyx_k__FMI_ENUMERATION), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_ERROR, __pyx_k__FMI_ERROR, sizeof(__pyx_k__FMI_ERROR), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_FALSE, __pyx_k__FMI_FALSE, sizeof(__pyx_k__FMI_FALSE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_FATAL, __pyx_k__FMI_FATAL, sizeof(__pyx_k__FMI_FATAL), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_INPUT, __pyx_k__FMI_INPUT, sizeof(__pyx_k__FMI_INPUT), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_INPUTS, __pyx_k__FMI_INPUTS, sizeof(__pyx_k__FMI_INPUTS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_INTEGER, __pyx_k__FMI_INTEGER, sizeof(__pyx_k__FMI_INTEGER), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_INTERNAL, __pyx_k__FMI_INTERNAL, sizeof(__pyx_k__FMI_INTERNAL), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_ME, __pyx_k__FMI_ME, sizeof(__pyx_k__FMI_ME), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_NEGATED_ALIAS, __pyx_k__FMI_NEGATED_ALIAS, sizeof(__pyx_k__FMI_NEGATED_ALIAS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_NONE, __pyx_k__FMI_NONE, sizeof(__pyx_k__FMI_NONE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_NO_ALIAS, __pyx_k__FMI_NO_ALIAS, sizeof(__pyx_k__FMI_NO_ALIAS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_OK, __pyx_k__FMI_OK, sizeof(__pyx_k__FMI_OK), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_OUTPUT, __pyx_k__FMI_OUTPUT, sizeof(__pyx_k__FMI_OUTPUT), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_OUTPUTS, __pyx_k__FMI_OUTPUTS, sizeof(__pyx_k__FMI_OUTPUTS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_PARAMETER, __pyx_k__FMI_PARAMETER, sizeof(__pyx_k__FMI_PARAMETER), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_PENDING, __pyx_k__FMI_PENDING, sizeof(__pyx_k__FMI_PENDING), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_REAL, __pyx_k__FMI_REAL, sizeof(__pyx_k__FMI_REAL), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_STATES, __pyx_k__FMI_STATES, sizeof(__pyx_k__FMI_STATES), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_STRING, __pyx_k__FMI_STRING, sizeof(__pyx_k__FMI_STRING), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_TRUE, __pyx_k__FMI_TRUE, sizeof(__pyx_k__FMI_TRUE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_WARNING, __pyx_k__FMI_WARNING, sizeof(__pyx_k__FMI_WARNING), 0, 0, 1, 1},
  {&__pyx_n_s__FMUException, __pyx_k__FMUException, sizeof(__pyx_k__FMUException), 0, 0, 1, 1},
  {&__pyx_n_s__Model, __pyx_k__Model, sizeof(__pyx_k__Model), 0, 0, 1, 1},
  {&__pyx_n_s__N, __pyx_k__N, sizeof(__pyx_k__N), 0, 0, 1, 1},
  {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s__PyEventInfo, __pyx_k__PyEventInfo, sizeof(__pyx_k__PyEventInfo), 0, 0, 1, 1},
  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s__Slave, __pyx_k__Slave, sizeof(__pyx_k__Slave), 0, 0, 1, 1},
  {&__pyx_n_s__StopTimeDefined, __pyx_k__StopTimeDefined, sizeof(__pyx_k__StopTimeDefined), 0, 0, 1, 1},
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
  {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1},
  {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s___default_options, __pyx_k___default_options, sizeof(__pyx_k___default_options), 0, 0, 1, 1},
  {&__pyx_n_s___fmu, __pyx_k___fmu, sizeof(__pyx_k___fmu), 0, 0, 1, 1},
  {&__pyx_n_s___get, __pyx_k___get, sizeof(__pyx_k___get), 0, 0, 1, 1},
  {&__pyx_n_s___get_alias, __pyx_k___get_alias, sizeof(__pyx_k___get_alias), 0, 0, 1, 1},
  {&__pyx_n_s___get_causality, __pyx_k___get_causality, sizeof(__pyx_k___get_causality), 0, 0, 1, 1},
  {&__pyx_n_s___get_description, __pyx_k___get_description, sizeof(__pyx_k___get_description), 0, 0, 1, 1},
  {&__pyx_n_s___get_name, __pyx_k___get_name, sizeof(__pyx_k___get_name), 0, 0, 1, 1},
  {&__pyx_n_s___get_time, __pyx_k___get_time, sizeof(__pyx_k___get_time), 0, 0, 1, 1},
  {&__pyx_n_s___get_type, __pyx_k___get_type, sizeof(__pyx_k___get_type), 0, 0, 1, 1},
  {&__pyx_n_s___get_types_platform, __pyx_k___get_types_platform, sizeof(__pyx_k___get_types_platform), 0, 0, 1, 1},
  {&__pyx_n_s___get_variability, __pyx_k___get_variability, sizeof(__pyx_k___get_variability), 0, 0, 1, 1},
  {&__pyx_n_s___get_version, __pyx_k___get_version, sizeof(__pyx_k___get_version), 0, 0, 1, 1},
  {&__pyx_n_s___set, __pyx_k___set, sizeof(__pyx_k___set), 0, 0, 1, 1},
  {&__pyx_n_s___set_time, __pyx_k___set_time, sizeof(__pyx_k___set_time), 0, 0, 1, 1},
  {&__pyx_n_s__abspath, __pyx_k__abspath, sizeof(__pyx_k__abspath), 0, 0, 1, 1},
  {&__pyx_n_s__alg, __pyx_k__alg, sizeof(__pyx_k__alg), 0, 0, 1, 1},
  {&__pyx_n_s__algdrive, __pyx_k__algdrive, sizeof(__pyx_k__algdrive), 0, 0, 1, 1},
  {&__pyx_n_s__algorithm, __pyx_k__algorithm, sizeof(__pyx_k__algorithm), 0, 0, 1, 1},
  {&__pyx_n_s__algorithm_drivers, __pyx_k__algorithm_drivers, sizeof(__pyx_k__algorithm_drivers), 0, 0, 1, 1},
  {&__pyx_n_s__alias, __pyx_k__alias, sizeof(__pyx_k__alias), 0, 0, 1, 1},
  {&__pyx_n_s__allocated_context, __pyx_k__allocated_context, sizeof(__pyx_k__allocated_context), 0, 0, 1, 1},
  {&__pyx_n_s__allocated_xml, __pyx_k__allocated_xml, sizeof(__pyx_k__allocated_xml), 0, 0, 1, 1},
  {&__pyx_n_s__array, __pyx_k__array, sizeof(__pyx_k__array), 0, 0, 1, 1},
  {&__pyx_n_s__base_path, __pyx_k__base_path, sizeof(__pyx_k__base_path), 0, 0, 1, 1},
  {&__pyx_n_s__basestring, __pyx_k__basestring, sizeof(__pyx_k__basestring), 0, 0, 1, 1},
  {&__pyx_n_s__callBackFunctions, __pyx_k__callBackFunctions, sizeof(__pyx_k__callBackFunctions), 0, 0, 1, 1},
  {&__pyx_n_s__callbacks, __pyx_k__callbacks, sizeof(__pyx_k__callbacks), 0, 0, 1, 1},
  {&__pyx_n_s__canHandleEvents, __pyx_k__canHandleEvents, sizeof(__pyx_k__canHandleEvents), 0, 0, 1, 1},
  {&__pyx_n_s__canRejectSteps, __pyx_k__canRejectSteps, sizeof(__pyx_k__canRejectSteps), 0, 0, 1, 1},
  {&__pyx_n_s__canSignalEvents, __pyx_k__canSignalEvents, sizeof(__pyx_k__canSignalEvents), 0, 0, 1, 1},
  {&__pyx_n_s__causality, __pyx_k__causality, sizeof(__pyx_k__causality), 0, 0, 1, 1},
  {&__pyx_n_s__context, __pyx_k__context, sizeof(__pyx_k__context), 0, 0, 1, 1},
  {&__pyx_n_s__continuous_states, __pyx_k__continuous_states, sizeof(__pyx_k__continuous_states), 0, 0, 1, 1},
  {&__pyx_n_s__create_temp_dir, __pyx_k__create_temp_dir, sizeof(__pyx_k__create_temp_dir), 0, 0, 1, 1},
  {&__pyx_n_s__current_t, __pyx_k__current_t, sizeof(__pyx_k__current_t), 0, 0, 1, 1},
  {&__pyx_n_s__delete_temp_dir, __pyx_k__delete_temp_dir, sizeof(__pyx_k__delete_temp_dir), 0, 0, 1, 1},
  {&__pyx_n_s__description, __pyx_k__description, sizeof(__pyx_k__description), 0, 0, 1, 1},
  {&__pyx_n_s__doc, __pyx_k__doc, sizeof(__pyx_k__doc), 0, 0, 1, 1},
  {&__pyx_n_s__double, __pyx_k__double, sizeof(__pyx_k__double), 0, 0, 1, 1},
  {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1},
  {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1},
  {&__pyx_n_s__enable_logging, __pyx_k__enable_logging, sizeof(__pyx_k__enable_logging), 0, 0, 1, 1},
  {&__pyx_n_s__endswith, __pyx_k__endswith, sizeof(__pyx_k__endswith), 0, 0, 1, 1},
  {&__pyx_n_s__fget, __pyx_k__fget, sizeof(__pyx_k__fget), 0, 0, 1, 1},
  {&__pyx_n_s__final_time, __pyx_k__final_time, sizeof(__pyx_k__final_time), 0, 0, 1, 1},
  {&__pyx_n_s__flatten, __pyx_k__flatten, sizeof(__pyx_k__flatten), 0, 0, 1, 1},
  {&__pyx_n_s__float, __pyx_k__float, sizeof(__pyx_k__float), 0, 0, 1, 1},
  {&__pyx_n_s__fmu, __pyx_k__fmu, sizeof(__pyx_k__fmu), 0, 0, 1, 1},
  {&__pyx_n_s__fmu_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__get_boolean, __pyx_k__get_boolean, sizeof(__pyx_k__get_boolean), 0, 0, 1, 1},
  {&__pyx_n_s__get_default_options, __pyx_k__get_default_options, sizeof(__pyx_k__get_default_options), 0, 0, 1, 1},
  {&__pyx_n_s__get_derivatives, __pyx_k__get_derivatives, sizeof(__pyx_k__get_derivatives), 0, 0, 1, 1},
  {&__pyx_n_s__get_integer, __pyx_k__get_integer, sizeof(__pyx_k__get_integer), 0, 0, 1, 1},
  {&__pyx_n_s__get_model_variables, __pyx_k__get_model_variables, sizeof(__pyx_k__get_model_variables), 0, 0, 1, 1},
  {&__pyx_n_s__get_real, __pyx_k__get_real, sizeof(__pyx_k__get_real), 0, 0, 1, 1},
  {&__pyx_n_s__get_result, __pyx_k__get_result, sizeof(__pyx_k__get_result), 0, 0, 1, 1},
  {&__pyx_n_s__get_string, __pyx_k__get_string, sizeof(__pyx_k__get_string), 0, 0, 1, 1},
  {&__pyx_n_s__get_variable_fixed, __pyx_k__get_variable_fixed, sizeof(__pyx_k__get_variable_fixed), 0, 0, 1, 1},
  {&__pyx_n_s__get_variable_max, __pyx_k__get_variable_max, sizeof(__pyx_k__get_variable_max), 0, 0, 1, 1},
  {&__pyx_n_s__get_variable_min, __pyx_k__get_variable_min, sizeof(__pyx_k__get_variable_min), 0, 0, 1, 1},
  {&__pyx_n_s__get_variable_start, __pyx_k__get_variable_start, sizeof(__pyx_k__get_variable_start), 0, 0, 1, 1},
  {&__pyx_n_s__include_alias, __pyx_k__include_alias, sizeof(__pyx_k__include_alias), 0, 0, 1, 1},
  {&__pyx_n_s__input, __pyx_k__input, sizeof(__pyx_k__input), 0, 0, 1, 1},
  {&__pyx_n_s__instantiate_model, __pyx_k__instantiate_model, sizeof(__pyx_k__instantiate_model), 0, 0, 1, 1},
  {&__pyx_n_s__instantiate_slave, __pyx_k__instantiate_slave, sizeof(__pyx_k__instantiate_slave), 0, 0, 1, 1},
  {&__pyx_n_s__int, __pyx_k__int, sizeof(__pyx_k__int), 0, 0, 1, 1},
  {&__pyx_n_s__int32, __pyx_k__int32, sizeof(__pyx_k__int32), 0, 0, 1, 1},
  {&__pyx_n_s__intermediateResult, __pyx_k__intermediateResult, sizeof(__pyx_k__intermediateResult), 0, 0, 1, 1},
  {&__pyx_n_s__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__last_error, __pyx_k__last_error, sizeof(__pyx_k__last_error), 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__logging, __pyx_k__logging, sizeof(__pyx_k__logging), 0, 0, 1, 1},
  {&__pyx_n_s__model, __pyx_k__model, sizeof(__pyx_k__model), 0, 0, 1, 1},
  {&__pyx_n_s__module, __pyx_k__module, sizeof(__pyx_k__module), 0, 0, 1, 1},
  {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
  {&__pyx_n_s__ndmin, __pyx_k__ndmin, sizeof(__pyx_k__ndmin), 0, 0, 1, 1},
  {&__pyx_n_s__new_step, __pyx_k__new_step, sizeof(__pyx_k__new_step), 0, 0, 1, 1},
  {&__pyx_n_s__nextEventTime, __pyx_k__nextEventTime, sizeof(__pyx_k__nextEventTime), 0, 0, 1, 1},
  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
  {&__pyx_n_s__only_fixed, __pyx_k__only_fixed, sizeof(__pyx_k__only_fixed), 0, 0, 1, 1},
  {&__pyx_n_s__only_start, __pyx_k__only_start, sizeof(__pyx_k__only_start), 0, 0, 1, 1},
  {&__pyx_n_s__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__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__property, __pyx_k__property, sizeof(__pyx_k__property), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 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__set_boolean, __pyx_k__set_boolean, sizeof(__pyx_k__set_boolean), 0, 0, 1, 1},
  {&__pyx_n_s__set_integer, __pyx_k__set_integer, sizeof(__pyx_k__set_integer), 0, 0, 1, 1},
  {&__pyx_n_s__set_real, __pyx_k__set_real, sizeof(__pyx_k__set_real), 0, 0, 1, 1},
  {&__pyx_n_s__set_string, __pyx_k__set_string, sizeof(__pyx_k__set_string), 0, 0, 1, 1},
  {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1},
  {&__pyx_n_s__solve, __pyx_k__solve, sizeof(__pyx_k__solve), 0, 0, 1, 1},
  {&__pyx_n_s__start_time, __pyx_k__start_time, sizeof(__pyx_k__start_time), 0, 0, 1, 1},
  {&__pyx_n_s__stateValuesChanged, __pyx_k__stateValuesChanged, sizeof(__pyx_k__stateValuesChanged), 0, 0, 1, 1},
  {&__pyx_n_s__step_size, __pyx_k__step_size, sizeof(__pyx_k__step_size), 0, 0, 1, 1},
  {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
  {&__pyx_n_s__tStart, __pyx_k__tStart, sizeof(__pyx_k__tStart), 0, 0, 1, 1},
  {&__pyx_n_s__tStop, __pyx_k__tStop, sizeof(__pyx_k__tStop), 0, 0, 1, 1},
  {&__pyx_n_s__terminateSimulation, __pyx_k__terminateSimulation, sizeof(__pyx_k__terminateSimulation), 0, 0, 1, 1},
  {&__pyx_n_s__time, __pyx_k__time, sizeof(__pyx_k__time), 0, 0, 1, 1},
  {&__pyx_n_s__tolControlled, __pyx_k__tolControlled, sizeof(__pyx_k__tolControlled), 0, 0, 1, 1},
  {&__pyx_n_s__type, __pyx_k__type, sizeof(__pyx_k__type), 0, 0, 1, 1},
  {&__pyx_n_s__types_platform, __pyx_k__types_platform, sizeof(__pyx_k__types_platform), 0, 0, 1, 1},
  {&__pyx_n_s__uint32, __pyx_k__uint32, sizeof(__pyx_k__uint32), 0, 0, 1, 1},
  {&__pyx_n_s__upcomingTimeEvent, __pyx_k__upcomingTimeEvent, sizeof(__pyx_k__upcomingTimeEvent), 0, 0, 1, 1},
  {&__pyx_n_s__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__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__warning, __pyx_k__warning, sizeof(__pyx_k__warning), 0, 0, 1, 1},
  {&__pyx_n_s__xrange, __pyx_k__xrange, sizeof(__pyx_k__xrange), 0, 0, 1, 1},
  {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_property = __Pyx_GetName(__pyx_b, __pyx_n_s__property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_basestring = __Pyx_GetName(__pyx_b, __pyx_n_s__basestring); if (!__pyx_builtin_basestring) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin___import__ = __Pyx_GetName(__pyx_b, __pyx_n_s____import__); if (!__pyx_builtin___import__) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "pyfmi\fmi.pyx":422
 * 
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu_full_path.endswith(".fmu"):             # <<<<<<<<<<<<<<
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_12);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
  PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));

  /* "pyfmi\fmi.pyx":423
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu_full_path.endswith(".fmu"):
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *         #Specify the general callback functions
 */
  __pyx_k_tuple_14 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_14);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_13));
  PyTuple_SET_ITEM(__pyx_k_tuple_14, 0, ((PyObject *)__pyx_kp_s_13));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));

  /* "pyfmi\fmi.pyx":454
 *                 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("PyFMI currently only supports FMI 1.0.")
 */
  __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_17);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
  PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));

  /* "pyfmi\fmi.pyx":456
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 *         if version != 1:
 *             raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *         #Parse the XML
 */
  __pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_19);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
  PyTuple_SET_ITEM(__pyx_k_tuple_19, 0, ((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));

  /* "pyfmi\fmi.pyx":465
 *         fmu_kind = FMIL.fmi1_import_get_fmu_kind(self._fmu)
 *         if fmu_kind != FMI_ME and fmu_kind != FMI_CS_STANDALONE:
 *             raise FMUException("PyFMI currently only supports FMI 1.0 for Model Exchange.")             # <<<<<<<<<<<<<<
 *         self._fmu_kind = fmu_kind
 * 
 */
  __pyx_k_tuple_21 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_21);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
  PyTuple_SET_ITEM(__pyx_k_tuple_21, 0, ((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));

  /* "pyfmi\fmi.pyx":477
 *                 raise FMUException(last_error)
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *             #raise FMUException("The DLL could not be loaded, reported error: "+ last_error)
 *         self._allocated_dll = True
 */
  __pyx_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_24);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_23));
  PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_kp_s_23));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));

  /* "pyfmi\fmi.pyx":645
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
  __pyx_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_26);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_25));
  PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_kp_s_25));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));

  /* "pyfmi\fmi.pyx":674
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_28 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_28);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_27));
  PyTuple_SET_ITEM(__pyx_k_tuple_28, 0, ((PyObject *)__pyx_kp_s_27));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_27));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28));

  /* "pyfmi\fmi.pyx":680
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
  __pyx_k_tuple_30 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_30);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 0, ((PyObject *)__pyx_kp_s_29));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));

  /* "pyfmi\fmi.pyx":712
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
  __pyx_k_tuple_32 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_32);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_31));
  PyTuple_SET_ITEM(__pyx_k_tuple_32, 0, ((PyObject *)__pyx_kp_s_31));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));

  /* "pyfmi\fmi.pyx":742
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_33 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_33);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_27));
  PyTuple_SET_ITEM(__pyx_k_tuple_33, 0, ((PyObject *)__pyx_kp_s_27));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_27));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33));

  /* "pyfmi\fmi.pyx":748
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_35 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_35);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
  PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, ((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));

  /* "pyfmi\fmi.pyx":794
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         return N.array(return_values)
 */
  __pyx_k_tuple_37 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_37);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_36));
  PyTuple_SET_ITEM(__pyx_k_tuple_37, 0, ((PyObject *)__pyx_kp_s_36));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_36));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));

  /* "pyfmi\fmi.pyx":836
 * 
 *         if val_ref.size != values.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_38 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_38);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_27));
  PyTuple_SET_ITEM(__pyx_k_tuple_38, 0, ((PyObject *)__pyx_kp_s_27));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_27));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));

  /* "pyfmi\fmi.pyx":845
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
  __pyx_k_tuple_40 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_40);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_39));
  PyTuple_SET_ITEM(__pyx_k_tuple_40, 0, ((PyObject *)__pyx_kp_s_39));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40));

  /* "pyfmi\fmi.pyx":949
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_42 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_42);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_41));
  PyTuple_SET_ITEM(__pyx_k_tuple_42, 0, ((PyObject *)__pyx_kp_s_41));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42));

  /* "pyfmi\fmi.pyx":987
 *         """
 *         if level < 0 or level > 7:
 *             raise FMUException("Invalid log level for FMI Library (0-7).")             # <<<<<<<<<<<<<<
 *         self.callbacks.log_level = level
 * 
 */
  __pyx_k_tuple_44 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_44);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_43));
  PyTuple_SET_ITEM(__pyx_k_tuple_44, 0, ((PyObject *)__pyx_kp_s_43));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44));

  /* "pyfmi\fmi.pyx":1010
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_46 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_46);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
  PyTuple_SET_ITEM(__pyx_k_tuple_46, 0, ((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46));

  /* "pyfmi\fmi.pyx":1032
 *             return self.get_boolean([ref])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_description(self, char* variablename):
 */
  __pyx_k_tuple_47 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_47);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
  PyTuple_SET_ITEM(__pyx_k_tuple_47, 0, ((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_45));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47));

  /* "pyfmi\fmi.pyx":1133
 *                 raise FMUException("The variable %s could not be found."%variablename)
 *         else:
 *             raise FMUException('Either provide value reference or variable name.')             # <<<<<<<<<<<<<<
 * 
 *         real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 */
  __pyx_k_tuple_54 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_54);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_53));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 0, ((PyObject *)__pyx_kp_s_53));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_53));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));

  /* "pyfmi\fmi.pyx":1137
 *         real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *         if real_variable == NULL:
 *             raise FMUException("The variable is not a real variable.")             # <<<<<<<<<<<<<<
 * 
 *         return  FMIL.fmi1_import_get_real_variable_nominal(real_variable)
 */
  __pyx_k_tuple_56 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_56);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_55));
  PyTuple_SET_ITEM(__pyx_k_tuple_56, 0, ((PyObject *)__pyx_kp_s_55));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_55));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));

  /* "pyfmi\fmi.pyx":1228
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self,char* variablename):
 */
  __pyx_k_tuple_59 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_59);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_58));
  PyTuple_SET_ITEM(__pyx_k_tuple_59, 0, ((PyObject *)__pyx_kp_s_58));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_58));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));

  /* "pyfmi\fmi.pyx":1268
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self,char* variablename):
 */
  __pyx_k_tuple_61 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_61);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_60));
  PyTuple_SET_ITEM(__pyx_k_tuple_61, 0, ((PyObject *)__pyx_kp_s_60));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_60));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));

  /* "pyfmi\fmi.pyx":1308
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_63 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_63);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_62));
  PyTuple_SET_ITEM(__pyx_k_tuple_63, 0, ((PyObject *)__pyx_kp_s_62));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_62));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63));

  /* "pyfmi\fmi.pyx":1630
 * 
 *         if self._fmu_kind != FMI_CS_STANDALONE:
 *             raise FMUException("This class only supports FMI 1.0 for Co-simulation.")             # <<<<<<<<<<<<<<
 * 
 *         self.instantiate_slave(logging = self._enable_logging)
 */
  __pyx_k_tuple_72 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_72);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_71));
  PyTuple_SET_ITEM(__pyx_k_tuple_72, 0, ((PyObject *)__pyx_kp_s_71));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_71));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_72));

  /* "pyfmi\fmi.pyx":1754
 *                 orders[i] = order
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")             # <<<<<<<<<<<<<<
 * 
 *         values = N.array([0.0]*nref,dtype=N.float, ndmin=1)
 */
  __pyx_k_tuple_76 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_76);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_75));
  PyTuple_SET_ITEM(__pyx_k_tuple_76, 0, ((PyObject *)__pyx_kp_s_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_76));

  /* "pyfmi\fmi.pyx":1761
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_78 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_78);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_77));
  PyTuple_SET_ITEM(__pyx_k_tuple_78, 0, ((PyObject *)__pyx_kp_s_77));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_77));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_78));

  /* "pyfmi\fmi.pyx":1813
 * 
 *         if order < 1:
 *             raise FMUException("The order must be greater than zero.")             # <<<<<<<<<<<<<<
 *         if not can_interpolate_inputs:
 *             raise FMUException("The FMU does not support input derivatives.")
 */
  __pyx_k_tuple_80 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_80);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_79));
  PyTuple_SET_ITEM(__pyx_k_tuple_80, 0, ((PyObject *)__pyx_kp_s_79));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_79));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_80));

  /* "pyfmi\fmi.pyx":1815
 *             raise FMUException("The order must be greater than zero.")
 *         if not can_interpolate_inputs:
 *             raise FMUException("The FMU does not support input derivatives.")             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(variables,str):
 */
  __pyx_k_tuple_82 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_82);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_81));
  PyTuple_SET_ITEM(__pyx_k_tuple_82, 0, ((PyObject *)__pyx_kp_s_81));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_81));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82));

  /* "pyfmi\fmi.pyx":1826
 *                 orders[i] = order
 *         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*>orders.data, <FMIL.fmi1_real_t*>val.data)
 */
  __pyx_k_tuple_83 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_83);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_75));
  PyTuple_SET_ITEM(__pyx_k_tuple_83, 0, ((PyObject *)__pyx_kp_s_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_83));

  /* "pyfmi\fmi.pyx":1831
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
  __pyx_k_tuple_85 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_85);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_84));
  PyTuple_SET_ITEM(__pyx_k_tuple_85, 0, ((PyObject *)__pyx_kp_s_84));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_84));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_85));

  /* "pyfmi\fmi.pyx":1947
 * 
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("The slave failed to initialize.")             # <<<<<<<<<<<<<<
 * 
 *         self._allocated_fmu = True
 */
  __pyx_k_tuple_95 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_95);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_94));
  PyTuple_SET_ITEM(__pyx_k_tuple_95, 0, ((PyObject *)__pyx_kp_s_94));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_94));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_95));

  /* "pyfmi\fmi.pyx":1988
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the slave.')             # <<<<<<<<<<<<<<
 * 
 *         #Just to be safe, some problems with Dymola (2012) FMUs not reacting
 */
  __pyx_k_tuple_99 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_99);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_98));
  PyTuple_SET_ITEM(__pyx_k_tuple_99, 0, ((PyObject *)__pyx_kp_s_98));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_98));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_99));

  /* "pyfmi\fmi.pyx":1995
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def get_capability_flags(self):
 */
  __pyx_k_tuple_100 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_100);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_41));
  PyTuple_SET_ITEM(__pyx_k_tuple_100, 0, ((PyObject *)__pyx_kp_s_41));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_100));

  /* "pyfmi\fmi.pyx":2040
 * 
 *         if self._fmu_kind != FMI_ME:
 *             raise FMUException("This class only supports FMI 1.0 for Model Exchange.")             # <<<<<<<<<<<<<<
 * 
 *         self.instantiate_model(logging = self._enable_logging)
 */
  __pyx_k_tuple_109 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_109);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_108));
  PyTuple_SET_ITEM(__pyx_k_tuple_109, 0, ((PyObject *)__pyx_kp_s_108));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_108));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_109));

  /* "pyfmi\fmi.pyx":2078
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);
 *         if status == FMIL.jm_status_error:
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")             # <<<<<<<<<<<<<<
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs
 * 
 */
  __pyx_k_tuple_111 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_111);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_110));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 0, ((PyObject *)__pyx_kp_s_110));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_110));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_111));

  /* "pyfmi\fmi.pyx":2123
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 * 
 *     time = property(_get_time,_set_time, doc =
 */
  __pyx_k_tuple_113 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_113);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_112));
  PyTuple_SET_ITEM(__pyx_k_tuple_113, 0, ((PyObject *)__pyx_kp_s_112));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_112));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_113));

  /* "pyfmi\fmi.pyx":2137
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_115 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_115);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_114));
  PyTuple_SET_ITEM(__pyx_k_tuple_115, 0, ((PyObject *)__pyx_kp_s_114));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_114));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_115));

  /* "pyfmi\fmi.pyx":2146
 * 
 *         if ndx.size != self._nContinuousStates:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to set the new continuous states. ' \
 *                 'The number of values are not consistent with the number of '\
 */
  __pyx_k_tuple_117 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_117);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_116));
  PyTuple_SET_ITEM(__pyx_k_tuple_117, 0, ((PyObject *)__pyx_kp_s_116));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_116));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_117));

  /* "pyfmi\fmi.pyx":2154
 * 
 *         if status >= 3:
 *             raise FMUException('Failed to set the new continuous states.')             # <<<<<<<<<<<<<<
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,
 */
  __pyx_k_tuple_119 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_119);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_118));
  PyTuple_SET_ITEM(__pyx_k_tuple_119, 0, ((PyObject *)__pyx_kp_s_118));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_118));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_119));

  /* "pyfmi\fmi.pyx":2171
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_121 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_121);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_120));
  PyTuple_SET_ITEM(__pyx_k_tuple_121, 0, ((PyObject *)__pyx_kp_s_120));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_120));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_121));

  /* "pyfmi\fmi.pyx":2202
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the derivative values.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_123 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_123);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_122));
  PyTuple_SET_ITEM(__pyx_k_tuple_123, 0, ((PyObject *)__pyx_kp_s_122));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_122));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_123));

  /* "pyfmi\fmi.pyx":2227
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_125 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_125);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_124));
  PyTuple_SET_ITEM(__pyx_k_tuple_125, 0, ((PyObject *)__pyx_kp_s_124));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_124));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_125));

  /* "pyfmi\fmi.pyx":2288
 * 
 *         if status != 0:
 *             raise FMUException('Failed to update the events.')             # <<<<<<<<<<<<<<
 * 
 *     def get_event_info(self):
 */
  __pyx_k_tuple_129 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_129);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_128));
  PyTuple_SET_ITEM(__pyx_k_tuple_129, 0, ((PyObject *)__pyx_kp_s_128));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_128));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_129));

  /* "pyfmi\fmi.pyx":2353
 * 
 *         if status != 0:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to get the continuous state reference values.')
 * 
 */
  __pyx_k_tuple_132 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_132);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_131));
  PyTuple_SET_ITEM(__pyx_k_tuple_132, 0, ((PyObject *)__pyx_kp_s_131));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_131));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_132));

  /* "pyfmi\fmi.pyx":2377
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         if callEventUpdate == 1:
 */
  __pyx_k_tuple_134 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_134);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_133));
  PyTuple_SET_ITEM(__pyx_k_tuple_134, 0, ((PyObject *)__pyx_kp_s_133));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_133));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_134));

  /* "pyfmi\fmi.pyx":2424
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_k_tuple_137 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_137);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_136));
  PyTuple_SET_ITEM(__pyx_k_tuple_137, 0, ((PyObject *)__pyx_kp_s_136));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_136));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_137));

  /* "pyfmi\fmi.pyx":2428
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 logging.warning('Initialize returned with a warning.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_k_tuple_139 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_139);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_138));
  PyTuple_SET_ITEM(__pyx_k_tuple_139, 0, ((PyObject *)__pyx_kp_s_138));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_138));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_139));

  /* "pyfmi\fmi.pyx":2433
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with a error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_k_tuple_141 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_141);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_140));
  PyTuple_SET_ITEM(__pyx_k_tuple_141, 0, ((PyObject *)__pyx_kp_s_140));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_140));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_141));

  /* "pyfmi\fmi.pyx":2437
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Initialize returned with a error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_k_tuple_143 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_143);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_142));
  PyTuple_SET_ITEM(__pyx_k_tuple_143, 0, ((PyObject *)__pyx_kp_s_142));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_142));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_143));

  /* "pyfmi\fmi.pyx":2474
 * 
 *         if status != 0:
 *             raise FMUException('Failed to instantiate the model.')             # <<<<<<<<<<<<<<
 * 
 *         #Just to be safe, some problems with Dymola (2012) FMUs not reacting
 */
  __pyx_k_tuple_146 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_146);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_145));
  PyTuple_SET_ITEM(__pyx_k_tuple_146, 0, ((PyObject *)__pyx_kp_s_145));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_145));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_146));

  /* "pyfmi\fmi.pyx":2481
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
  __pyx_k_tuple_147 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_147);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_41));
  PyTuple_SET_ITEM(__pyx_k_tuple_147, 0, ((PyObject *)__pyx_kp_s_41));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_147));

  /* "pyfmi\fmi.pyx":2612
 * 
 *     # Check that the file referenced by fmu has the correct file-ending
 *     if not fmu_full_path.endswith(".fmu"):             # <<<<<<<<<<<<<<
 *         raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_k_tuple_154 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_154);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
  PyTuple_SET_ITEM(__pyx_k_tuple_154, 0, ((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_154));

  /* "pyfmi\fmi.pyx":2613
 *     # Check that the file referenced by fmu has the correct file-ending
 *     if not fmu_full_path.endswith(".fmu"):
 *         raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *     #Specify the general callback functions
 */
  __pyx_k_tuple_155 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_155);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_13));
  PyTuple_SET_ITEM(__pyx_k_tuple_155, 0, ((PyObject *)__pyx_kp_s_13));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_155));

  /* "pyfmi\fmi.pyx":2645
 *             raise FMUException("The FMU version could not be determined. "+last_error)
 *         else:
 *             raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *     if version != 1:
 *         #Delete the context
 */
  __pyx_k_tuple_156 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_156);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
  PyTuple_SET_ITEM(__pyx_k_tuple_156, 0, ((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_156));

  /* "pyfmi\fmi.pyx":2651
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Parse the XML
 */
  __pyx_k_tuple_157 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_157);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
  PyTuple_SET_ITEM(__pyx_k_tuple_157, 0, ((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_157));

  /* "pyfmi\fmi.pyx":2672
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0 for Model Exchange.")             # <<<<<<<<<<<<<<
 * 
 *     #Delete the XML
 */
  __pyx_k_tuple_158 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_158);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
  PyTuple_SET_ITEM(__pyx_k_tuple_158, 0, ((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_158));

  /* "numpy.pxd":214
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_k_tuple_160 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_160)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_160);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_159));
  PyTuple_SET_ITEM(__pyx_k_tuple_160, 0, ((PyObject *)__pyx_kp_u_159));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_159));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_160));

  /* "numpy.pxd":218
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_k_tuple_162 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_162)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_162);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_161));
  PyTuple_SET_ITEM(__pyx_k_tuple_162, 0, ((PyObject *)__pyx_kp_u_161));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_161));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_162));

  /* "numpy.pxd":256
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
  __pyx_k_tuple_164 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_164)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_164);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_163));
  PyTuple_SET_ITEM(__pyx_k_tuple_164, 0, ((PyObject *)__pyx_kp_u_163));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_163));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_164));

  /* "numpy.pxd":798
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 */
  __pyx_k_tuple_167 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_167)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_167);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_166));
  PyTuple_SET_ITEM(__pyx_k_tuple_167, 0, ((PyObject *)__pyx_kp_u_166));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_166));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_167));

  /* "numpy.pxd":802
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
  __pyx_k_tuple_168 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_168)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_168);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_163));
  PyTuple_SET_ITEM(__pyx_k_tuple_168, 0, ((PyObject *)__pyx_kp_u_163));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_163));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_168));

  /* "numpy.pxd":822
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
  __pyx_k_tuple_170 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_170)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_170);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_169));
  PyTuple_SET_ITEM(__pyx_k_tuple_170, 0, ((PyObject *)__pyx_kp_u_169));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_169));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_170));

  /* "pyfmi\fmi.pyx":2588
 *         FMUModelME1.__init__(self,fmu,path,enable_logging)
 * 
 * def load_fmu(fmu, path='.', enable_logging=True):             # <<<<<<<<<<<<<<
 *     """
 *     Helper function for loading FMUs of different kinds.
 */
  __pyx_k_tuple_187 = PyTuple_New(15); if (unlikely(!__pyx_k_tuple_187)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_187);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 0, ((PyObject *)__pyx_n_s__fmu));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__path));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 1, ((PyObject *)__pyx_n_s__path));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__path));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__enable_logging));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 2, ((PyObject *)__pyx_n_s__enable_logging));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__enable_logging));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__callBackFunctions));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 3, ((PyObject *)__pyx_n_s__callBackFunctions));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__callBackFunctions));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__callbacks));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 4, ((PyObject *)__pyx_n_s__callbacks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__callbacks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__context));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 5, ((PyObject *)__pyx_n_s__context));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__context));
  __Pyx_INCREF(((PyObject *)__pyx_n_s___fmu));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 6, ((PyObject *)__pyx_n_s___fmu));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s___fmu));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__last_error));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 7, ((PyObject *)__pyx_n_s__last_error));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__last_error));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__allocated_context));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 8, ((PyObject *)__pyx_n_s__allocated_context));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__allocated_context));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__allocated_xml));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 9, ((PyObject *)__pyx_n_s__allocated_xml));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__allocated_xml));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu_temp_dir));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 10, ((PyObject *)__pyx_n_s__fmu_temp_dir));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu_temp_dir));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu_full_path));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 11, ((PyObject *)__pyx_n_s__fmu_full_path));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu_full_path));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__version));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 12, ((PyObject *)__pyx_n_s__version));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__version));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fmu_kind));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 13, ((PyObject *)__pyx_n_s__fmu_kind));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fmu_kind));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__model));
  PyTuple_SET_ITEM(__pyx_k_tuple_187, 14, ((PyObject *)__pyx_n_s__model));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__model));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_187));
  __pyx_k_codeobj_188 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_189, __pyx_n_s__load_fmu, 2588, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_188)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initfmi(void); /*proto*/
PyMODINIT_FUNC initfmi(void)
#else
PyMODINIT_FUNC PyInit_fmi(void); /*proto*/
PyMODINIT_FUNC PyInit_fmi(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_fmi(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("fmi"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_171), 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_pyfmi__fmi) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_BaseModel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "BaseModel", (PyObject *)&__pyx_type_5pyfmi_3fmi_BaseModel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_BaseModel = &__pyx_type_5pyfmi_3fmi_BaseModel;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_ScalarVariable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "ScalarVariable", (PyObject *)&__pyx_type_5pyfmi_3fmi_ScalarVariable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_ScalarVariable = &__pyx_type_5pyfmi_3fmi_ScalarVariable;
  __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.get_variable_description = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_description;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_data_type = (enum fmi1_base_type_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_data_type;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_valueref = (fmi1_value_reference_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_valueref;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_fixed = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_fixed;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_start = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_start;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_max = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_max;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_min = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_min;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_variability = (enum fmi1_variability_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_variability;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_causality = (enum fmi1_causality_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, char *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_causality;
  __pyx_type_5pyfmi_3fmi_FMUModelBase.tp_base = __pyx_ptype_5pyfmi_3fmi_BaseModel;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_FMUModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelBase, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__.doc = __pyx_doc_5pyfmi_3fmi_12FMUModelBase___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__;
    }
  }
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelBase.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FMUModelBase", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __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 = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelCS1.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelCS1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FMUModelCS1", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelCS1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __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 = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelME1.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelME1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FMUModelME1", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelME1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModelME1 = &__pyx_type_5pyfmi_3fmi_FMUModelME1;
  __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 = 2583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModel.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FMUModel", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModel = &__pyx_type_5pyfmi_3fmi_FMUModel;
  /*--- Type import code ---*/
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "pyfmi\fmi.pyx":20
 * Module containing the FMI interface Python wrappers.
 * """
 * import os             # <<<<<<<<<<<<<<
 * import sys
 * import logging
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__os), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":21
 * """
 * import os
 * import sys             # <<<<<<<<<<<<<<
 * import logging
 * 
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":22
 * import os
 * import sys
 * import logging             # <<<<<<<<<<<<<<
 * 
 * import numpy as N
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__logging), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logging, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":24
 * import logging
 * 
 * import numpy as N             # <<<<<<<<<<<<<<
 * cimport numpy as N
 * 
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__N, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":27
 * cimport numpy as N
 * 
 * N.import_array()             # <<<<<<<<<<<<<<
 * 
 * cimport fmil_import as FMIL
 */
  import_array();

  /* "pyfmi\fmi.pyx":31
 * cimport fmil_import as FMIL
 * 
 * from pyfmi.common.core import create_temp_dir, delete_temp_dir             # <<<<<<<<<<<<<<
 * #from pyfmi.common.core cimport BaseModel
 * 
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__create_temp_dir));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__create_temp_dir));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__create_temp_dir));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__delete_temp_dir));
  PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__delete_temp_dir));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delete_temp_dir));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_172), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__create_temp_dir);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__create_temp_dir);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__create_temp_dir, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__delete_temp_dir);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__delete_temp_dir);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__delete_temp_dir, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __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":35
 * 
 * 
 * int = N.int32             # <<<<<<<<<<<<<<
 * N.int = N.int32
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__int, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":36
 * 
 * int = N.int32
 * N.int = N.int32             # <<<<<<<<<<<<<<
 * 
 * """Basic flags related to FMI"""
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__int, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":40
 * """Basic flags related to FMI"""
 * 
 * FMI_TRUE = '\x01'             # <<<<<<<<<<<<<<
 * FMI_FALSE = '\x00'
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_TRUE, ((PyObject *)__pyx_kp_s_173)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":41
 * 
 * FMI_TRUE = '\x01'
 * FMI_FALSE = '\x00'             # <<<<<<<<<<<<<<
 * 
 * # Status
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_FALSE, ((PyObject *)__pyx_kp_s_174)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":44
 * 
 * # Status
 * FMI_OK = FMIL.fmi1_status_ok             # <<<<<<<<<<<<<<
 * FMI_WARNING = FMIL.fmi1_status_warning
 * FMI_DISCARD = FMIL.fmi1_status_discard
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_status_ok); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_OK, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":45
 * # Status
 * FMI_OK = FMIL.fmi1_status_ok
 * FMI_WARNING = FMIL.fmi1_status_warning             # <<<<<<<<<<<<<<
 * FMI_DISCARD = FMIL.fmi1_status_discard
 * FMI_ERROR = FMIL.fmi1_status_error
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_status_warning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_WARNING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":46
 * FMI_OK = FMIL.fmi1_status_ok
 * FMI_WARNING = FMIL.fmi1_status_warning
 * FMI_DISCARD = FMIL.fmi1_status_discard             # <<<<<<<<<<<<<<
 * FMI_ERROR = FMIL.fmi1_status_error
 * FMI_FATAL = FMIL.fmi1_status_fatal
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_status_discard); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_DISCARD, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":47
 * FMI_WARNING = FMIL.fmi1_status_warning
 * FMI_DISCARD = FMIL.fmi1_status_discard
 * FMI_ERROR = FMIL.fmi1_status_error             # <<<<<<<<<<<<<<
 * FMI_FATAL = FMIL.fmi1_status_fatal
 * FMI_PENDING = FMIL.fmi1_status_pending
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_status_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_ERROR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":48
 * FMI_DISCARD = FMIL.fmi1_status_discard
 * FMI_ERROR = FMIL.fmi1_status_error
 * FMI_FATAL = FMIL.fmi1_status_fatal             # <<<<<<<<<<<<<<
 * FMI_PENDING = FMIL.fmi1_status_pending
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_status_fatal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_FATAL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":49
 * FMI_ERROR = FMIL.fmi1_status_error
 * FMI_FATAL = FMIL.fmi1_status_fatal
 * FMI_PENDING = FMIL.fmi1_status_pending             # <<<<<<<<<<<<<<
 * 
 * # Types
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_status_pending); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_PENDING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":52
 * 
 * # Types
 * FMI_REAL = FMIL.fmi1_base_type_real             # <<<<<<<<<<<<<<
 * FMI_INTEGER  = FMIL.fmi1_base_type_int
 * FMI_BOOLEAN = FMIL.fmi1_base_type_bool
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_base_type_real); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_REAL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":53
 * # Types
 * FMI_REAL = FMIL.fmi1_base_type_real
 * FMI_INTEGER  = FMIL.fmi1_base_type_int             # <<<<<<<<<<<<<<
 * FMI_BOOLEAN = FMIL.fmi1_base_type_bool
 * FMI_STRING = FMIL.fmi1_base_type_str
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_base_type_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_INTEGER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":54
 * FMI_REAL = FMIL.fmi1_base_type_real
 * FMI_INTEGER  = FMIL.fmi1_base_type_int
 * FMI_BOOLEAN = FMIL.fmi1_base_type_bool             # <<<<<<<<<<<<<<
 * FMI_STRING = FMIL.fmi1_base_type_str
 * FMI_ENUMERATION = FMIL.fmi1_base_type_enum
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_base_type_bool); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_BOOLEAN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":55
 * FMI_INTEGER  = FMIL.fmi1_base_type_int
 * FMI_BOOLEAN = FMIL.fmi1_base_type_bool
 * FMI_STRING = FMIL.fmi1_base_type_str             # <<<<<<<<<<<<<<
 * FMI_ENUMERATION = FMIL.fmi1_base_type_enum
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_base_type_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_STRING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":56
 * FMI_BOOLEAN = FMIL.fmi1_base_type_bool
 * FMI_STRING = FMIL.fmi1_base_type_str
 * FMI_ENUMERATION = FMIL.fmi1_base_type_enum             # <<<<<<<<<<<<<<
 * 
 * # Alias data
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_base_type_enum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_ENUMERATION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":59
 * 
 * # Alias data
 * FMI_NO_ALIAS = FMIL.fmi1_variable_is_not_alias             # <<<<<<<<<<<<<<
 * FMI_ALIAS = FMIL.fmi1_variable_is_alias
 * FMI_NEGATED_ALIAS = FMIL.fmi1_variable_is_negated_alias
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_variable_is_not_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_NO_ALIAS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":60
 * # Alias data
 * FMI_NO_ALIAS = FMIL.fmi1_variable_is_not_alias
 * FMI_ALIAS = FMIL.fmi1_variable_is_alias             # <<<<<<<<<<<<<<
 * FMI_NEGATED_ALIAS = FMIL.fmi1_variable_is_negated_alias
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_variable_is_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_ALIAS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":61
 * FMI_NO_ALIAS = FMIL.fmi1_variable_is_not_alias
 * FMI_ALIAS = FMIL.fmi1_variable_is_alias
 * FMI_NEGATED_ALIAS = FMIL.fmi1_variable_is_negated_alias             # <<<<<<<<<<<<<<
 * 
 * # Variability
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_variable_is_negated_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_NEGATED_ALIAS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":64
 * 
 * # Variability
 * FMI_CONTINUOUS = FMIL.fmi1_variability_enu_continuous             # <<<<<<<<<<<<<<
 * FMI_CONSTANT = FMIL.fmi1_variability_enu_constant
 * FMI_PARAMETER = FMIL.fmi1_variability_enu_parameter
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_variability_enu_continuous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_CONTINUOUS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":65
 * # Variability
 * FMI_CONTINUOUS = FMIL.fmi1_variability_enu_continuous
 * FMI_CONSTANT = FMIL.fmi1_variability_enu_constant             # <<<<<<<<<<<<<<
 * FMI_PARAMETER = FMIL.fmi1_variability_enu_parameter
 * FMI_DISCRETE = FMIL.fmi1_variability_enu_discrete
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_variability_enu_constant); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_CONSTANT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":66
 * FMI_CONTINUOUS = FMIL.fmi1_variability_enu_continuous
 * FMI_CONSTANT = FMIL.fmi1_variability_enu_constant
 * FMI_PARAMETER = FMIL.fmi1_variability_enu_parameter             # <<<<<<<<<<<<<<
 * FMI_DISCRETE = FMIL.fmi1_variability_enu_discrete
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_variability_enu_parameter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_PARAMETER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":67
 * FMI_CONSTANT = FMIL.fmi1_variability_enu_constant
 * FMI_PARAMETER = FMIL.fmi1_variability_enu_parameter
 * FMI_DISCRETE = FMIL.fmi1_variability_enu_discrete             # <<<<<<<<<<<<<<
 * 
 * # Causality
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_variability_enu_discrete); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_DISCRETE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":70
 * 
 * # Causality
 * FMI_INPUT = FMIL.fmi1_causality_enu_input             # <<<<<<<<<<<<<<
 * FMI_OUTPUT = FMIL.fmi1_causality_enu_output
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_causality_enu_input); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_INPUT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":71
 * # Causality
 * FMI_INPUT = FMIL.fmi1_causality_enu_input
 * FMI_OUTPUT = FMIL.fmi1_causality_enu_output             # <<<<<<<<<<<<<<
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal
 * FMI_NONE = FMIL.fmi1_causality_enu_none
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_causality_enu_output); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_OUTPUT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":72
 * FMI_INPUT = FMIL.fmi1_causality_enu_input
 * FMI_OUTPUT = FMIL.fmi1_causality_enu_output
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal             # <<<<<<<<<<<<<<
 * FMI_NONE = FMIL.fmi1_causality_enu_none
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_causality_enu_internal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_INTERNAL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":73
 * FMI_OUTPUT = FMIL.fmi1_causality_enu_output
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal
 * FMI_NONE = FMIL.fmi1_causality_enu_none             # <<<<<<<<<<<<<<
 * 
 * # FMI types
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_causality_enu_none); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_NONE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":76
 * 
 * # FMI types
 * FMI_ME = FMIL.fmi1_fmu_kind_enu_me             # <<<<<<<<<<<<<<
 * FMI_CS_STANDALONE = FMIL.fmi1_fmu_kind_enu_cs_standalone
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_fmu_kind_enu_me); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_ME, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":77
 * # FMI types
 * FMI_ME = FMIL.fmi1_fmu_kind_enu_me
 * FMI_CS_STANDALONE = FMIL.fmi1_fmu_kind_enu_cs_standalone             # <<<<<<<<<<<<<<
 * 
 * FMI_MIME_CS_STANDALONE = "application/x-fmu-sharedlibrary"
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_fmu_kind_enu_cs_standalone); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_CS_STANDALONE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":79
 * FMI_CS_STANDALONE = FMIL.fmi1_fmu_kind_enu_cs_standalone
 * 
 * FMI_MIME_CS_STANDALONE = "application/x-fmu-sharedlibrary"             # <<<<<<<<<<<<<<
 * 
 * FMI_REGISTER_GLOBALLY = 1
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_97, ((PyObject *)__pyx_kp_s_175)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":81
 * FMI_MIME_CS_STANDALONE = "application/x-fmu-sharedlibrary"
 * 
 * FMI_REGISTER_GLOBALLY = 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_22, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":87
 * """Flags for evaluation of FMI Jacobians"""
 * """Evaluate Jacobian w.r.t. states."""
 * FMI_STATES = 1             # <<<<<<<<<<<<<<
 * """Evaluate Jacobian w.r.t. inputs."""
 * FMI_INPUTS = 2
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_STATES, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":89
 * FMI_STATES = 1
 * """Evaluate Jacobian w.r.t. inputs."""
 * FMI_INPUTS = 2             # <<<<<<<<<<<<<<
 * """Evaluate Jacobian of derivatives."""
 * FMI_DERIVATIVES = 1
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_INPUTS, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":91
 * FMI_INPUTS = 2
 * """Evaluate Jacobian of derivatives."""
 * FMI_DERIVATIVES = 1             # <<<<<<<<<<<<<<
 * """Evaluate Jacobian of outputs."""
 * FMI_OUTPUTS = 2
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_DERIVATIVES, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":93
 * FMI_DERIVATIVES = 1
 * """Evaluate Jacobian of outputs."""
 * FMI_OUTPUTS = 2             # <<<<<<<<<<<<<<
 * 
 * #CALLBACKS
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_OUTPUTS, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":248
 *         return algorithm.get_default_options()
 * 
 * class FMUException(Exception):             # <<<<<<<<<<<<<<
 *     """
 *     An FMU exception.
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_176)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1), __pyx_n_s__FMUException, __pyx_n_s_177); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMUException, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":254
 *     pass
 * 
 * class PyEventInfo():             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1), __pyx_n_s__PyEventInfo, __pyx_n_s_177); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PyEventInfo, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":270
 * 
 *     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 = 270; __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":271
 *     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 = 271; __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":272
 *                        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 = 272; __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":291
 *         """
 *         return self._name
 *     name = property(_get_name)             # <<<<<<<<<<<<<<
 * 
 *     def _get_value_reference(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s___get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __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 = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__name, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __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":302
 *         """
 *         return self._value_reference
 *     value_reference = property(_get_value_reference)             # <<<<<<<<<<<<<<
 * 
 *     def _get_type(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s_178); 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_3 = PyTuple_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);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__value_reference, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __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":314
 *         """
 *         return self._type
 *     type = property(_get_type)             # <<<<<<<<<<<<<<
 * 
 *     def _get_description(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s___get_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __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 = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__type, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __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":326
 *         """
 *         return self._description
 *     description = property(_get_description)             # <<<<<<<<<<<<<<
 * 
 *     def _get_variability(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s___get_description); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __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 = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__description, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __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":338
 *         """
 *         return self._variability
 *     variability = property(_get_variability)             # <<<<<<<<<<<<<<
 * 
 *     def _get_causality(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s___get_variability); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __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 = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__variability, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __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":350
 *         """
 *         return self._causality
 *     causality = property(_get_causality)             # <<<<<<<<<<<<<<
 * 
 *     def _get_alias(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s___get_causality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __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 = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__causality, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __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":362
 *         """
 *         return self._alias
 *     alias = property(_get_alias)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s___get_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __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 = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__alias, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __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":399
 *     cdef int _fmu_kind
 * 
 *     def __init__(self, fmu, path='.', enable_logging=True):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor.
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_10 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":594
 *         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 = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelBase, __pyx_n_s___get_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__fget), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelBase->tp_dict, __pyx_n_s__version, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelBase);

  /* "pyfmi\fmi.pyx":1346
 * 
 * 
 *     def get_model_variables(self,type=None, include_alias=True,             # <<<<<<<<<<<<<<
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False):
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k_64 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1348
 *     def get_model_variables(self,type=None, include_alias=True,
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False):             # <<<<<<<<<<<<<<
 *         """
 *         Extract the names of the variables in a model.
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k_65 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k_66 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1625
 *     #fmiResetSlave not supported
 * 
 *     def __init__(self, fmu, path='.', enable_logging=True):             # <<<<<<<<<<<<<<
 *         #Call super
 *         FMUModelBase.__init__(self,fmu,path,enable_logging)
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k_70 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1640
 *         self.__t = t
 * 
 *     time = property(_get_time,_set_time, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the current time of the simulation. Calls the
 */
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1, __pyx_n_s___get_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1, __pyx_n_s___set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __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 = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_179)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1->tp_dict, __pyx_n_s__time, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelCS1);

  /* "pyfmi\fmi.pyx":1666
 *             FMIL.fmi_import_free_context(self.context)
 * 
 *     def do_step(self, FMIL.fmi1_real_t current_t, FMIL.fmi1_real_t step_size, new_step=True):             # <<<<<<<<<<<<<<
 *         """
 *         Performs an integrator step.
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k_73 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1781
 *         return FMIL.fmi1_import_get_types_platform(self._fmu)
 * 
 *     types_platform = property(fget=_get_types_platform)             # <<<<<<<<<<<<<<
 * 
 *     def set_input_derivatives(self, variables, values, FMIL.fmi1_integer_t order):
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1, __pyx_n_s___get_types_platform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__fget), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1->tp_dict, __pyx_n_s__types_platform, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __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":1834
 * 
 *     def simulate(self,
 *                  start_time=0.0,             # <<<<<<<<<<<<<<
 *                  final_time=1.0,
 *                  input=(),
 */
  __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_86 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1835
 *     def simulate(self,
 *                  start_time=0.0,
 *                  final_time=1.0,             # <<<<<<<<<<<<<<
 *                  input=(),
 *                  algorithm='FMICSAlg',
 */
  __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_87 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "pyfmi\fmi.pyx":1920
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def initialize(self, tStart=0.0, tStop=1.0, StopTimeDefined=False):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the slave.
 */
  __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_91 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_92 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_93 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1951
 *         self._allocated_fmu = True
 * 
 *     def instantiate_slave(self, name='Slave', logging=False):             # <<<<<<<<<<<<<<
 *         """
 *         Instantiate the slave.
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_96 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2035
 *     """
 * 
 *     def __init__(self, fmu, path='.', enable_logging=True):             # <<<<<<<<<<<<<<
 *         #Call super
 *         FMUModelBase.__init__(self,fmu,path,enable_logging)
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_107 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2060
 *         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 = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_180); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__fget), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s_181, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME1);

  /* "pyfmi\fmi.pyx":2125
 *             raise FMUException('Failed to set the time.')
 * 
 *     time = property(_get_time,_set_time, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the current time of the simulation. Calls the
 */
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s___get_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s___set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __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 = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_179)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s__time, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME1);

  /* "pyfmi\fmi.pyx":2156
 *             raise FMUException('Failed to set the new continuous states.')
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,             # <<<<<<<<<<<<<<
 *         doc=
 *     """
 */
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_182); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_183); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __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 = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_184)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s__continuous_states, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME1);

  /* "pyfmi\fmi.pyx":2175
 *         return ndx
 * 
 *     nominal_continuous_states = property(_get_nominal_continuous_states, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the nominal values of the continuous states. Calls
 */
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_185); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_186)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s_126, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; __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":2257
 *         return [rtol, atol]
 * 
 *     def event_update(self, intermediateResult=False):             # <<<<<<<<<<<<<<
 *         """
 *         Updates the event information at the current time-point. If
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_127 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2385
 * 
 * 
 *     def initialize(self, tolControlled=True, relativeTolerance=None):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the model and computes initial values for all variables,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_135 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2443
 * 
 * 
 *     def instantiate_model(self, name='Model', logging=False):             # <<<<<<<<<<<<<<
 *         """
 *         Instantiate the model.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_144 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2484
 * 
 *     def simulate(self,
 *                  start_time=0.0,             # <<<<<<<<<<<<<<
 *                  final_time=1.0,
 *                  input=(),
 */
  __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_148 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2485
 *     def simulate(self,
 *                  start_time=0.0,
 *                  final_time=1.0,             # <<<<<<<<<<<<<<
 *                  input=(),
 *                  algorithm='AssimuloFMIAlg',
 */
  __pyx_t_2 = PyFloat_FromDouble(1.0); 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_k_149 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2488
 *                  input=(),
 *                  algorithm='AssimuloFMIAlg',
 *                  options={}):             # <<<<<<<<<<<<<<
 *         """
 *         Compact function for model simulation.
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_k_150 = ((PyObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2584
 * #Temporary should be removed! (after a period)
 * cdef class FMUModel(FMUModelME1):
 *     def __init__(self, fmu, path='.', enable_logging=True):             # <<<<<<<<<<<<<<
 *         print "WARNING: This class is deprecated and has been superseded with FMUModelME1. The recommended entry-point for loading an FMU is now the function load_fmu."
 *         FMUModelME1.__init__(self,fmu,path,enable_logging)
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); 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_k_151 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2588
 *         FMUModelME1.__init__(self,fmu,path,enable_logging)
 * 
 * def load_fmu(fmu, path='.', enable_logging=True):             # <<<<<<<<<<<<<<
 *     """
 *     Helper function for loading FMUs of different kinds.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_153 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_1load_fmu, NULL, __pyx_n_s_177); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__load_fmu, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1
 * #!/usr/bin/env python             # <<<<<<<<<<<<<<
 * # -*- coding: utf-8 -*-
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "numpy.pxd":974
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  if (__pyx_m) {
    __Pyx_AddTraceback("init pyfmi.fmi", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pyfmi.fmi");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%s() takes %s %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_T"d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AS_STRING(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static PyObject* __Pyx_Globals() {
    Py_ssize_t i;
    /*PyObject *d;*/
    PyObject *names = NULL;
    PyObject *globals = PyObject_GetAttrString(__pyx_m, "__dict__");
    if (!globals) {
        PyErr_SetString(PyExc_TypeError,
            "current module must have __dict__ attribute");
        goto bad;
    }
    names = PyObject_Dir(__pyx_m);
    if (!names)
        goto bad;
    for (i = 0; i < PyList_GET_SIZE(names); i++) {
        PyObject* name = PyList_GET_ITEM(names, i);
        if (!PyDict_Contains(globals, name)) {
            PyObject* value = PyObject_GetAttr(__pyx_m, PyList_GET_ITEM(names, i));
            if (!value)
                goto bad;
            if (PyDict_SetItem(globals, name, value) < 0) {
                Py_DECREF(value);
                goto bad;
            }
        }
    }
    Py_DECREF(names);
    return globals;
    /*
    d = PyDictProxy_New(globals);
    Py_DECREF(globals);
    return d;
    */
bad:
    Py_XDECREF(names);
    Py_XDECREF(globals);
    return NULL;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else /* Python 3+ */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (!PyExceptionClass_Check(type)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        }
        else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        }
        else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        if (!value) {
            value = PyObject_CallObject(type, NULL);
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    return;
}
#endif



static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  unsigned int n = 1;
  return *(unsigned char*)(&n) != 0;
}
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t < '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1) /* First char was not a digit */
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case 'b': return "'char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparseable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      __Pyx_BufFmt_RaiseExpected(ctx);
      return -1;
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %"PY_FORMAT_SIZE_T"d but %"PY_FORMAT_SIZE_T"d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count; /* Consume from buffer string */
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break; /* breaks both loops as ctx->enc_count == 0 */
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue; /* empty struct */
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static CYTHON_INLINE PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number;
    int ndim = ctx->head->field->type->ndim;
;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return NULL;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
    while (*ts && *ts != ')') {
        if (isspace(*ts))
            continue;
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return NULL;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
            return PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
        if (*ts != ',' && *ts != ')')
            return PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim)
        return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return NULL;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return Py_None;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
                return ts;
      case ' ':
      case 10:
      case 13:
        ++ts;
        break;
      case '<':
        if (!__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T': /* substruct */
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0; /* Erase processed last struct element */
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}': /* end of substruct; either repeat or move on */
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0; /* Erase processed last struct element */
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }        /* fall through */
      case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 's': case 'p':
        if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
            ctx->enc_packmode == ctx->new_packmode) {
          ctx->enc_count += ctx->new_count;
        } else {
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_count = ctx->new_count;
          ctx->enc_packmode = ctx->new_packmode;
          ctx->enc_type = *ts;
          ctx->is_complex = got_Z;
        }
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}
static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}
static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  if (obj == Py_None || obj == NULL) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if ((unsigned)buf->itemsize != dtype->size) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%"PY_FORMAT_SIZE_T"d byte%s) does not match size of '%s' (%"PY_FORMAT_SIZE_T"d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  return -1;
}
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (info->buf == NULL) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}

static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_Format(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

static void __Pyx_RaiseBufferIndexError(int axis) {
  PyErr_Format(PyExc_IndexError,
     "Out of bounds on buffer access (axis %d)", axis);
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %"PY_FORMAT_SIZE_T"d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    PyObject *getbuffer_cobj;

  #if PY_VERSION_HEX >= 0x02060000
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
  #endif

        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);

  #if PY_VERSION_HEX < 0x02060000
    if (obj->ob_type->tp_dict &&
        (getbuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
                                             "__pyx_getbuffer"))) {
        getbufferproc func;

      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
        func = (getbufferproc) PyCapsule_GetPointer(getbuffer_cobj, "getbuffer(obj, view, flags)");
      #else
        func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
      #endif
        Py_DECREF(getbuffer_cobj);
        if (!func)
            goto fail;

        return func(obj, view, flags);
    } else {
        PyErr_Clear();
    }
  #endif

    PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);

#if PY_VERSION_HEX < 0x02060000
fail:
#endif

    return -1;
}

static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    PyObject *releasebuffer_cobj;

    if (!obj) return;

  #if PY_VERSION_HEX >= 0x02060000
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
  #endif

        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }

  #if PY_VERSION_HEX < 0x02060000
    if (obj->ob_type->tp_dict &&
        (releasebuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
                                                      "__pyx_releasebuffer"))) {
        releasebufferproc func;

      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
        func = (releasebufferproc) PyCapsule_GetPointer(releasebuffer_cobj, "releasebuffer(obj, view)");
      #else
        func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
      #endif

        Py_DECREF(releasebuffer_cobj);

        if (!func)
            goto fail;

        func(obj, view);
        return;
    } else {
        PyErr_Clear();
    }
  #endif

    goto nofail;

#if PY_VERSION_HEX < 0x02060000
fail:
#endif
    PyErr_WriteUnraisable(obj);

nofail:
    Py_DECREF(obj);
    view->obj = NULL;
}

#endif /*  PY_MAJOR_VERSION < 3 */

    static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    #if PY_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                /* try package relative import first */
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
#if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
                 PyString_AsString(name));
#else
    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
#endif
}

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
    PyObject *metaclass;
    /* Default metaclass */
#if PY_MAJOR_VERSION < 3
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = PyObject_GetAttrString(base, (char *)"__class__");
        if (!metaclass) {
            PyErr_Clear();
            metaclass = (PyObject*) Py_TYPE(base);
        }
    } else {
        metaclass = (PyObject *) &PyClass_Type;
    }
#else
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = (PyObject*) Py_TYPE(base);
    } else {
        metaclass = (PyObject *) &PyType_Type;
    }
#endif
    Py_INCREF(metaclass);
    return metaclass;
}

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname) {
    PyObject *result;
    PyObject *metaclass;
    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
        return NULL;
    /* Python2 __metaclass__ */
    metaclass = PyDict_GetItemString(dict, "__metaclass__");
    if (metaclass) {
        Py_INCREF(metaclass);
    } else {
        metaclass = __Pyx_FindPy2Metaclass(bases);
    }
    result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
    Py_DECREF(metaclass);
    return result;
}

#if PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    PyObject* v;
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                return -1;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            return -1;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0 &&
                isspace(Py_CHARMASK(s[len-1])) &&
                s[len-1] != ' ')
                    PyFile_SoftSpace(f, 0);
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            return -1;
        PyFile_SoftSpace(f, 0);
    }
    return 0;
}
#else /* Python 3 has a print function */
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItemString(kwargs, "file", stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItemString(kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

#if PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            return -1;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        return -1;
    if (PyFile_WriteString("\n", f) < 0)
        return -1;
    return 0;
    /* the line below is just to avoid compiler
     * compiler warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else /* Python 3 has a print function */
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_New(1);
    if (unlikely(!arg_tuple))
        return -1;
    Py_INCREF(o);
    PyTuple_SET_ITEM(arg_tuple, 0, o);
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = PyObject_GetAttr(o, n);
    if (!r) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

static CYTHON_INLINE fmi1_value_reference_t __Pyx_PyInt_from_py_fmi1_value_reference_t(PyObject* x) {
    const fmi1_value_reference_t neg_one = (fmi1_value_reference_t)-1, const_zero = (fmi1_value_reference_t)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(fmi1_value_reference_t) == sizeof(char)) {
        if (is_unsigned)
            return (fmi1_value_reference_t)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (fmi1_value_reference_t)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(fmi1_value_reference_t) == sizeof(short)) {
        if (is_unsigned)
            return (fmi1_value_reference_t)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (fmi1_value_reference_t)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(fmi1_value_reference_t) == sizeof(int)) {
        if (is_unsigned)
            return (fmi1_value_reference_t)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (fmi1_value_reference_t)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(fmi1_value_reference_t) == sizeof(long)) {
        if (is_unsigned)
            return (fmi1_value_reference_t)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (fmi1_value_reference_t)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(fmi1_value_reference_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (fmi1_value_reference_t)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (fmi1_value_reference_t)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        fmi1_value_reference_t val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        return (fmi1_value_reference_t)-1;
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_value_reference_t(fmi1_value_reference_t val) {
    const fmi1_value_reference_t neg_one = (fmi1_value_reference_t)-1, const_zero = (fmi1_value_reference_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(fmi1_value_reference_t) == sizeof(char))  ||
        (sizeof(fmi1_value_reference_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(fmi1_value_reference_t) == sizeof(int)) ||
               (sizeof(fmi1_value_reference_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(fmi1_value_reference_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(fmi1_value_reference_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE size_t __Pyx_PyInt_from_py_size_t(PyObject* x) {
    const size_t neg_one = (size_t)-1, const_zero = (size_t)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(size_t) == sizeof(char)) {
        if (is_unsigned)
            return (size_t)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (size_t)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(size_t) == sizeof(short)) {
        if (is_unsigned)
            return (size_t)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (size_t)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(size_t) == sizeof(int)) {
        if (is_unsigned)
            return (size_t)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (size_t)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(size_t) == sizeof(long)) {
        if (is_unsigned)
            return (size_t)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (size_t)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(size_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (size_t)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (size_t)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        size_t val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        return (size_t)-1;
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_size_t(size_t val) {
    const size_t neg_one = (size_t)-1, const_zero = (size_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(size_t) == sizeof(char))  ||
        (sizeof(size_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(size_t) == sizeof(int)) ||
               (sizeof(size_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(size_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(size_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_boolean_t(fmi1_boolean_t val) {
    const fmi1_boolean_t neg_one = (fmi1_boolean_t)-1, const_zero = (fmi1_boolean_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(fmi1_boolean_t) == sizeof(char))  ||
        (sizeof(fmi1_boolean_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(fmi1_boolean_t) == sizeof(int)) ||
               (sizeof(fmi1_boolean_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(fmi1_boolean_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(fmi1_boolean_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_integer_t(fmi1_integer_t val) {
    const fmi1_integer_t neg_one = (fmi1_integer_t)-1, const_zero = (fmi1_integer_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(fmi1_integer_t) == sizeof(char))  ||
        (sizeof(fmi1_integer_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(fmi1_integer_t) == sizeof(int)) ||
               (sizeof(fmi1_integer_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(fmi1_integer_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(fmi1_integer_t),
                                     little, !is_unsigned);
    }
}

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        float denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(a, a);
                    case 3:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, a);
                    case 4:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_absf(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        double denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(a, a);
                    case 3:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, a);
                    case 4:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_abs(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static CYTHON_INLINE fmi1_integer_t __Pyx_PyInt_from_py_fmi1_integer_t(PyObject* x) {
    const fmi1_integer_t neg_one = (fmi1_integer_t)-1, const_zero = (fmi1_integer_t)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(fmi1_integer_t) == sizeof(char)) {
        if (is_unsigned)
            return (fmi1_integer_t)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (fmi1_integer_t)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(fmi1_integer_t) == sizeof(short)) {
        if (is_unsigned)
            return (fmi1_integer_t)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (fmi1_integer_t)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(fmi1_integer_t) == sizeof(int)) {
        if (is_unsigned)
            return (fmi1_integer_t)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (fmi1_integer_t)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(fmi1_integer_t) == sizeof(long)) {
        if (is_unsigned)
            return (fmi1_integer_t)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (fmi1_integer_t)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(fmi1_integer_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (fmi1_integer_t)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (fmi1_integer_t)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        fmi1_integer_t val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        return (fmi1_integer_t)-1;
    }
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (!strict && (size_t)((PyTypeObject *)result)->tp_basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        if (PyErr_Warn(NULL, warning) < 0) goto bad;
        #else
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
        #endif
    }
    else if ((size_t)((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = (start + end) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,      /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_globals = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}


/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
